From: Drew Raines Date: 2007-04-19T01:15:04+09:00 Subject: Re: Hpricot getting a table lrlebron@gmail.com wrote: > At this point data contains html that looks like this > >
Stuff
Stuff
>
Stuff
Stuff
>
Stuff
Stuff
>
Stuff
Stuff
> > More stuff continues ...... > > I want capture each of these four tables individually for further > processing. I have tried a variety of methods but nothing seems to > work. Would something as simple as this work? I'm not sure how complex your tables get. #!/usr/bin/env ruby require "hpricot" doc = Hpricot("
Stuff
Stuff
Stuff
Stuff
Stuff
Stuff
Stuff
Stuff
") (doc/"table").map {|t| puts t.to_html} This outputs: "
Stuff
Stuff
" "
Stuff
Stuff
" "
Stuff
Stuff
" "
Stuff
Stuff
" Note that there's an Hpricot mailing list at http://code.whytheluckystiff.net/hpricot/ that might be a more appropriate forum for these questions. -Drew