Created
September 26, 2009 13:48
-
-
Save thesurlydev/194228 to your computer and use it in GitHub Desktop.
Google search
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'scrubyt' | |
google_data = Scrubyt::Extractor.define do | |
fetch 'http://www.google.com/search?hl=en&q=ruby+-weight' | |
link_title "//a[@class='l']", :write_text => true do | |
link_url | |
end | |
snippet "//div[@class='s']" | |
next_page "Next", :limit => 1 | |
end | |
p google_data.to_xml.gsub(/ - Cached - Similar/, '') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment