Created
May 8, 2013 03:59
-
-
Save marcioferreira/5538091 to your computer and use it in GitHub Desktop.
alexa br 1-500
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
use common::sense; | |
use Web::Scraper; | |
my $csv = ''; | |
my $dom = scraper{ | |
process 'div.desc-container', 'site[]' => scraper { | |
process 'span.topsites-label', 'domain' => 'TEXT'; | |
process 'h2 a', 'name' => 'TEXT'; | |
}}; | |
for my $n (1..20) { | |
my $u = URI->new("http://www.alexa.com/topsites/countries;$n/BR"); | |
my $res = $dom->scrape( $u )->{site}; | |
say "$_->{name};$_->{domain}" for @$res; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment