From: Wang Jian Date: 2009-04-20T11:04:22+09:00 Subject: Re: hpricot parsing --00163630f4a1d0826d0467f2f200 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Makes me wonder if ReXML, Hpricot or Nokogiri has a to_hash method...not yet found. I'd also be glad to know. 2009/4/20 Marc Farber > Ruby newbie here > > Have successfully used hpricot to scrape correct
from desired page > http://www.montgomeryadvertiser.com/section/obits using > > doc = Hpricot(uri above) > ... > @grab1 = doc.search("//div[@class='article-bodytext']") > > target data is in following logical form > >
>

name of funeral home

>

deceased1

>
advertising crap
>

funeral home 2

>

deceased 2

>

deceased 3

>
> > I'm struggling to iterate thru this div, plucking a array or hash where > I can feed a database with each record being a funeral home and person. > I was thinking I could go thru each of the @grab1 elements and process > according to tag type and establish the "record" logic thru simple > knowing that a new record starts with each new h3 tag. > > Any help for a newbie with first Ruby script? > > > Thx > -- > Posted via http://www.ruby-forum.com/. > > --00163630f4a1d0826d0467f2f200--