From: Vivek Netha Date: 2009-01-08T07:30:06+09:00 Subject: Re: Help with HTML parsing Hi Philip, could you give me more pointers on how exactly you would do it using REXML. with actual code, if possible. thx. Phlip wrote: > Vivek Netha wrote: > >> 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?? > > Don't use Hpricot - its XPath support only covers a very few predicate > and path > types. Use libxml-ruby, if you can install it, or REXML, if you don't > mind the > slow speed (the RE stands for Regular Expressions!), or nokogiri, which > I don't > know how to recommend yet, but I will soon. > > BTW Google for my street-name and XPath for all kinds of fun in Ruby > with them. -- Posted via http://www.ruby-forum.com/.