M
M P
I am using the Hpricot(which is awesome!) ruby module to do screen
scraping. When I retrieve a list of search results, it returns a
custom data type "Hpricot::Elements." I am trying to treat this
returned list as an array, but keep getting errors. How can I convert
this to an array of my results? I have tried '.to_a' but that doesn't
work.
Thank You for your time. Here is a code example:
doc = Hpricot(open("my url"))
@conts = doc.search("form[@name='form']/div")
scraping. When I retrieve a list of search results, it returns a
custom data type "Hpricot::Elements." I am trying to treat this
returned list as an array, but keep getting errors. How can I convert
this to an array of my results? I have tried '.to_a' but that doesn't
work.
Thank You for your time. Here is a code example:
doc = Hpricot(open("my url"))
@conts = doc.search("form[@name='form']/div")