HTML extraction using ruby

Discussion in 'Ruby' started by Arun Kumar, Mar 13, 2009.

  1. Arun Kumar

    Arun Kumar Guest

    Hi,
    Can anybody tell me how to extract all the hyperlinks given in the
    url:http://scores.sify.com/match/archive/archive.shtml using ruby. I
    want the those urls having the class 'com_blue com_size12 com_arial12'.
    ie. to be more precise
    <a class="com_blue com_size12 com_arial12" href="">, these are the type
    of urls i want to have.
    Please help. I'll be really greatfull.

    Regards,
    Arun Kumar .C.M.
    --
    Posted via http://www.ruby-forum.com/.
    Arun Kumar, Mar 13, 2009
    #1
    1. Advertising

  2. Arun Kumar

    Phlip Guest

    Arun Kumar wrote:
    > Hi,
    > Can anybody tell me how to extract all the hyperlinks given in the
    > url:http://scores.sify.com/match/archive/archive.shtml using ruby. I
    > want the those urls having the class 'com_blue com_size12 com_arial12'.
    > ie. to be more precise
    > <a class="com_blue com_size12 com_arial12" href="">, these are the type
    > of urls i want to have.


    Use doc = Nokogiri::HTML( my_html ), then something like doc.css('a.com_blue').each
    Phlip, Mar 13, 2009
    #2
    1. Advertising

  3. Arun Kumar

    Arun Kumar Guest

    Phlip wrote:
    > Arun Kumar wrote:
    >> Hi,
    >> Can anybody tell me how to extract all the hyperlinks given in the
    >> url:http://scores.sify.com/match/archive/archive.shtml using ruby. I
    >> want the those urls having the class 'com_blue com_size12 com_arial12'.
    >> ie. to be more precise
    >> <a class="com_blue com_size12 com_arial12" href="">, these are the type
    >> of urls i want to have.

    >
    > Use doc = Nokogiri::HTML( my_html ), then something like
    > doc.css('a.com_blue').each


    Sorry that doesn't work. Showing an error like this.

    uninitialized constant Nokogiri (NameError)

    Regards
    Arun Kumar
    --
    Posted via http://www.ruby-forum.com/.
    Arun Kumar, Mar 14, 2009
    #3
  4. Arun Kumar

    Phlip Guest

    Arun Kumar wrote:

    > Sorry that doesn't work. Showing an error like this.
    >
    > uninitialized constant Nokogiri (NameError)


    You are going to need to learn more Ruby before asking high-level questions
    about it.

    What did Google tell you about Nokogiri, or RubyGems?
    Phlip, Mar 14, 2009
    #4
    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. Himanshu Garg
    Replies:
    0
    Views:
    622
    Himanshu Garg
    Jan 27, 2004
  2. MaggieMagill

    HTML info extraction utility

    MaggieMagill, Mar 3, 2005, in forum: HTML
    Replies:
    5
    Views:
    364
    Andy Dingley
    Mar 4, 2005
  3. Replies:
    0
    Views:
    618
  4. Replies:
    4
    Views:
    442
    Nick Kew
    Dec 7, 2004
  5. Replies:
    0
    Views:
    346
Loading...

Share This Page