Currently I’m doing the following:
if( firstTemp == true )
total = doc.xpath("//div[@class='pricing condense']").text
else
total = doc.xpath("//div[@class='pricing ']").text
end
I’m wondering is there anyway that I can get mechanize to automatically fetch divs that contain the string “pricing” ?
Is
docaMechanize::Page? usually the convention ispagefor those anddocforNokogiri::HTML::Document. Anyway, for either one try:For just the first one, use
atinstead ofsearch: