School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,419 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,557 people online right now. Registration is fast and FREE... Join Now!




extracting links in a webpage based on link's class type

 

extracting links in a webpage based on link's class type

sita12

17 Nov, 2008 - 11:28 AM
Post #1

New D.I.C Head
*

Joined: 17 Nov, 2008
Posts: 1

Navigate to google and click the search button by giving "ruby" as search text
This navigates to a page where it shows first 10 webpages descriptions(title, desc and link).
I want the title and link of each page collected and post it to a log/output file.

I tried using scrubyt extractor, I got all the links ..unalbe to get the titles.
Dont know whether is it possible thru scruby or not...
Please help me
My scrubyt code..

require 'rubygems'
require 'scrubyt'

google_data = Scrubyt::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 = google_data.to_xml
puts junk


Thanks,



User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/7/09 11:37PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month