Created
March 18, 2013 11:14
-
-
Save polarblau/5186511 to your computer and use it in GitHub Desktop.
Simple crawler API
This file contains 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
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