Skip to content

Instantly share code, notes, and snippets.

@polarblau
Created March 18, 2013 11:14
Show Gist options
  • Save polarblau/5186511 to your computer and use it in GitHub Desktop.
Save polarblau/5186511 to your computer and use it in GitHub Desktop.
Simple crawler API
options = { :wait => 10 }
# one big set
result = Crawler.crawl("http://www.example.com", options)
result.image
result.style_sheets
result.scripts # => [<Crawler::Response::Script>]
...
result.errors
# per page
Crawler.crawl("http://www.example.com", options) do |page|
page.images
...
page.document # =>
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment