Firefox inserts <tbody> tags to the DOM and firebug gets the modified
code. If you print the code mechanize gets I bet there are no tbody
tags, so try removing tbody from the xpath.
On 31 maj 2009, at 23.44, Tim Stinnett wrote:
> I am trying to scrape a web page using xpath to search with.
>
> page.search("//tr/td").each do |my_tag|
> This works fine, but there are about 1 million tags that fit this on
> the page I am looking at.
>
> If I put the full xpath as reported by Firebug I get 0 matches.
> Where oh where am I messing this up.
>
> page.search("/html/body/div[2]/table/tbody/tr/td/table/tbody/tr/
> td[3]/table[2]/tbody/tr/td/table/tbody/tr/td/div/table/tbody/tr/td/
> table/tbody/tr/td/table/tbody/tr/td/table/tbody/tr/td/table[2]/tbody/
> tr[2]/td").each do |my_tag|
>
> Maybe this should be asked in a Xpath forum but here I am.
> _______________________________________________
> Mechanize-users mailing list
> Mechanize-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mechanize-users