Skip to content

Instantly share code, notes, and snippets.

@aerith
Created June 9, 2009 04:53
Show Gist options
  • Save aerith/126279 to your computer and use it in GitHub Desktop.
Save aerith/126279 to your computer and use it in GitHub Desktop.
#!/usr/local/bin/perl --
use strict;
use warnings;
use URI;
use Web::Scraper;
use YAML;
my $endpoint = 'http://movapic.com/hoge/follower?max=9999';
my $movapic = scraper {
process 'div.body div.black > table.userprofile', 'user[]' => sub {
my($node) = @_;
my($user) = $node->look_down(_tag => 'a')->attr('href') =~ /\/([^\/]+)$/i;
undef $node;
$user;
}
};
my $result = $movapic->scrape( URI->new($endpoint) );
print YAML::Dump($result);
exit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment