How to get texts from 'td' tags from 'table' on html page by using Mechanize gem?
I almost always use mechanize with nokogiri. This guide helped me get started.
Something like this should work (Untested):
require 'mechanize'
require 'nokogiri'
agent = Mechanize.new
page = agent.get("http://www.google.com/")
doc = Nokogiri::HTML(page.body, "UTF-8")
doc.xpath('//td').each do |node|
puts node.text
end
More information on nokogiri here