From: Squawk Boxed Date: 2011-03-11T03:28:23+09:00 Subject: Scraping with Nokogiri while using Mechanize 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: agent = Mechanize.new page = agent.get('http://google.com/') google_form = page.form('f') google_form.q = 'ruby mechanize' page = agent.submit(google_form) page.xpath('//h3/a[@class="l"]').each do |link| puts link.content end But this works: page = Nokogiri::HTML(open('http://www.google.com/search?q=ruby+mechanize')) page.xpath('//h3/a[@class="l"]').each do |link| puts link.content end Any advice? -- Posted via http://www.ruby-forum.com/.