HTML extraction using ruby

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
, these are the type
of urls i want to have.
Please help. I’ll be really greatfull.

Regards,
Arun K. .C.M.

Arun K. 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
, 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 wrote:

Arun K. 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
, 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 K.

Arun K. 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?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs