Skip to content

Instantly share code, notes, and snippets.

@marcioferreira
Created May 8, 2013 03:59
Show Gist options
  • Save marcioferreira/5538091 to your computer and use it in GitHub Desktop.
Save marcioferreira/5538091 to your computer and use it in GitHub Desktop.
alexa br 1-500
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