From: Vivek Netha Date: 2009-01-03T07:26:28+09:00 Subject: Re: Help with HTML parsing ok, i've started to work with hpricot. i'm debating if i should use open-uri or watir. but thats another discussion. my current issue is, though, with xpath. this is what i have so far... #!ruby require 'watir' require 'open-uri' require 'rubygems' require 'hpricot' Watir.options_file = 'c:/ruby/options.yml' Watir::Browser.default = 'ie' test_site = "http://www.google.com" br = Watir::Browser.new br.goto test_site br.text_field(:name, 'q').set("Dungeons & Dragons") br.button(:name, 'btnG').click doc = Hpricot(br.html) #after the above, i'm trying to store all result elements in an array x = Array.new x << doc.search("//li[@class='g w0']/h3/a") the XPath checker in firefox shows that I have the right path. but the command doesn't work in irb. how do i drill down to specific elements so that i can extract the title text and url? and wats wrong with my xpath?? plz help! Viv. -- Posted via http://www.ruby-forum.com/.