[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

HTML extraction using ruby

Arun Kumar

3/13/2009 5:30:00 AM

Hi,
Can anybody tell me how to extract all the hyperlinks given in the
url:http://scores.sify.com/match/archive/arc... 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-....

3 Answers

Phlip

3/13/2009 12:25:00 PM

0

Arun Kumar wrote:
> Hi,
> Can anybody tell me how to extract all the hyperlinks given in the
> url:http://scores.sify.com/match/archive/arc... 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


Arun Kumar

3/14/2009 3:41:00 AM

0

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/arc... 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-....

Phlip

3/14/2009 4:14:00 AM

0

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?