The Mechanize documentation says to just start scraping with Nokogiri
once you've navigated to the right page with Mechanize, but this example
doesn't seem to work for me:
The Mechanize part works fine. I navigate to the page I want and when I
pretty print I get the page I want. The problem is I don't know how to
scrape data from the page with Nokogiri once I've navigated to it. For
example, this is how you would do it with pure Nokogiri:
page.xpath('//h3/a[@class="l"]').each do |link|
puts link.content
end
It's a trivial example, but for the data I'm scraping I need to use
Mechanize to navigate to the page, so I can't just use Nokogiri. The
thing is the Mechanize documentation says, I should be able to use
regular Nokogiri methods, but they don't seem to work for me.