Help with Hpricot and collect

Discussion in 'Ruby' started by John Zoldiark, Dec 18, 2008.

  1. 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 part of the code that I am reading, and I need the part that is
    not in tags:

    <table cellspacing="0" cellpadding="0" border="0" width="289">
    <tbody>
    <tr>
    </tr>
    <tr>
    <td height="5"/>
    </tr>
    <tr>
    <td class="det_movie" align="left">6:25 9:20 p.m. (Mon./Fri.) 4:00 p.m.
    (No previews) (Sat./Sun./Hol.) 1:00 p.m. (No previews) 3:30 p.m.</td>
    </tr>
    <tr>

    the file is very large and I need all the objects with the
    class="det_movie".

    thanks for any help
    --
    Posted via http://www.ruby-forum.com/.
    John Zoldiark, Dec 18, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John
    Replies:
    1
    Views:
    388
    John C. Bollinger
    Aug 19, 2004
  2. Victor
    Replies:
    5
    Views:
    418
    Philip Baker
    Aug 18, 2005
  3. Johnny Sandaire
    Replies:
    7
    Views:
    376
    Karl Heinz Buchegger
    Nov 27, 2003
  4. Sandeep Arya
    Replies:
    0
    Views:
    922
    Sandeep Arya
    Jul 15, 2005
  5. Sandeep Arya
    Replies:
    0
    Views:
    3,383
    Sandeep Arya
    Jul 19, 2005
Loading...

Share This Page