[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Hpricot problem with free text

John Zoldiark

12/17/2008 10:50:00 PM

Hi and thanks for the help, I am new to ruby and I am trying to get some
data from a website using the Hpricot library.I am doing this: links =
Hpricot(index_page).search("td.det_movie").collect{ |link| link["href"]
} to get an array of data but the thing is that right now I need some
text out of tags and the previous version only works with tags.
This is the code that I am reading, and I need the part "The Day the
Earth Stood Still"

<a class="link" href="detalle_movie.php?mv_id=618">The Day the Earth
Stood Still</a>

thanks for any help
--
Posted via http://www.ruby-....

2 Answers

Sebastian W.

12/17/2008 11:53:00 PM

0

Hi John,
I haven't used Hpricot much, but you may want to dig through the API
documentation a bit more. Also, why's website has a few good tutorials
on how to grab data in different ways.

I believe the method you want to be looking at is "innerHTML" (or some
such name).

HTH

John Zoldiark wrote:
> Hi and thanks for the help, I am new to ruby and I am trying to get some
> data from a website using the Hpricot library.I am doing this: links =
> Hpricot(index_page).search("td.det_movie").collect{ |link| link["href"]
> } to get an array of data but the thing is that right now I need some
> text out of tags and the previous version only works with tags.
> This is the code that I am reading, and I need the part "The Day the
> Earth Stood Still"
>
> <a class="link" href="detalle_movie.php?mv_id=618">The Day the Earth
> Stood Still</a>
>
> thanks for any help

--
Posted via http://www.ruby-....

John Zoldiark

12/18/2008 12:46:00 AM

0

Thanks for the idea but I have already try innerHTML but is returning
the data but not in an array structure. I need something similar to
innerHTML.collect or something like that. I have read a lot of
documentation about Hpricot but I have not see something to fix my
problem.

--
Posted via http://www.ruby-....