On 10/6/06, Gavin Kistner <gavin.kistner / anark.com> wrote:
> From: Jamie Macey [mailto:jamie.macey / gmail.com]
> > require 'rubygems'; require 'hpricot'; require 'open-uri'
> > doc = Hpricot(open('http://www.unix.org/version3/apis/cu.html'))
> > puts (doc/"p.tent/i").map{|i|i.inner_html}
>
> Actually...I can't get Hpricot to install to test your code (gem server
> seems to be down) but doesn't that grab way more information than you
> wanted from the table? The table headers and all columns, too?

I am pulling the entire html file down, but by dividing the Hpricot
instance I'm essentially asking it to give me all the <i> tags that
are inside a <p> with the tent class.  Given the content of the file I
could probably just do doc/"i" but it would also grab the 'opt' from
the definition list up top.

My code does give the same output as yours, excepting that since I'm
putsing the array rather than joining I get one command per line.

- Jamie