Hpricot problem with free text

J

John Zoldiark

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
 
S

Sebastian W.

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 said:
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
 
J

John Zoldiark

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Help with Hpricot and collect 0
Using Hpricot with HTML's 3
inner_html = "" in hpricot 0
Hpricot inner_html 1
HTML parser using Hpricot 0
need help with Hpricot 2
Html parsing with Hpricot 2
Hpricot Help 0

Members online

No members online now.

Forum statistics

Threads
474,181
Messages
2,570,970
Members
47,537
Latest member
BellCorone

Latest Threads

Top