From: Marc Farber Date: 2009-04-20T01:12:27+09:00 Subject: hpricot parsing 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/.