Skip to content

Instantly share code, notes, and snippets.

@nilbus
Created April 23, 2010 20:20
Show Gist options
  • Save nilbus/377120 to your computer and use it in GitHub Desktop.
Save nilbus/377120 to your computer and use it in GitHub Desktop.
require 'lib/scrubyt'
@extractor = Scrubyt::Extractor.new do
fetch "http://www.google.com/search?&q=ruby"
books "ul.results li" do
title "//h2"
author "p.author"
book_detail "h2 a" do
name "//title"
summary "//p[1]"
end
end
next_page "Next"
end
puts @extractor.results.inspect
[{:title => },
{:author => }]
[
{ :example_node => { :url => ["foobar", ""], :name => "Glenn Gillen"}},
{ :example_node => { :url => "http:////..../", :name => "Someone Else"}},
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment