Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dann/2765 to your computer and use it in GitHub Desktop.
Save dann/2765 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use Web::Scraper;
use URI;
my $uri = URI->new("http://dann.g.hatena.ne.jp/keywordlist");
my $scraper = scraper {
process '//div[@class="refererlist"]/ul/li/a', 'keywords[]' => {
name => 'TEXT',
url => '@href',
};
};
my $result = $scraper->scrape($uri);
use Data::Dumper;
warn Dumper $result;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment