On 2008.11.17., at 19:17, Sita Rami Reddy wrote:

> I have a web page which has n number of links.
> The only i can differentiate links is with their class attribute.
> I need the extract the set of links and their titles of a particular  
> class
> type.
>
> I tried using scrubyt exractor, dont have idea where to specify the  
> class
> type.
>
> google_data = Scrubyt::Extractor.define do
> fetch 'http://www.google.com/'
> fill_textfield 'q', 'ruby'
> submit
> link "Ruby programming language" do
> url "href", :type => :attribute
> end
> junk = google_data.to_xml
>
>
> And how to get the output in text/string format.

btw. you should get the newest scRUBYt! , 0.4.05 which does *not*  
depend on RubyInline, Ruby2Ruby and ParseTree etc.

What would you like to do exactly?

1) class: use an xpath like this: stuff "//td[@class='red']"
2) text/string: use to_hash instead of to_xml.

HTH,
Peter
___
http://www.rubyrailways.com
http://scrubyt.org