------art_33832_17947477.1226950506567
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

My program need to do the following
Navigate to google site, providing "ruby" as search text, clicked the search
button
Now we get the results page showing 1st 10 results.

I like to collect those 10 links and titles of those links and log them in
an output file
using scrubyt extractor, i achived some thing, got all those 10 links
captured..but i am unable to get the titles.
And also i know how to extract in XML format...

but i need in this way .each Title and its Link in a single line

My scripts goes here..

require 'rubygems'
require 'scrubyt'

google_data  crubyt::Extractor.define do
#Perform the action(s)
fetch 'http://www.google.com/'
fill_textfield 'q', 'Gap Inc'
submit
#Construct the wrapper
link "gap" do
url "href", :type :attribute
end
next_page "Next", :limit 10
end
junk  oogle_data.to_xml
puts junk

Please help me out..
Suggest anyother way, if this doesn't work out

Thanks,
Sita.





On Mon, Nov 17, 2008 at 10:59 AM, Peter Szinek <peter / rubyrailways.com>wrote:

> 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  crubyt::Extractor.define do
>> fetch 'http://www.google.com/'
>> fill_textfield 'q', 'ruby'
>> submit
>> link "Ruby programming language" do
>> url "href", :type :attribute
>> end
>> junk  oogle_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[@classed']"
> 2) text/string: use to_hash instead of to_xml.
>
> HTH,
> Peter
> ___
> http://www.rubyrailways.com
> http://scrubyt.org
>
>


-- 
Sita Rami Reddy P

------art_33832_17947477.1226950506567--