Created
July 22, 2009 03:26
-
-
Save aerith/151774 to your computer and use it in GitHub Desktop.
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
#!/usr/local/bin/perl -- | |
use strict; | |
use warnings; | |
use Web::Scraper; | |
use HTML::TreeBuilder::LibXML; | |
sub get_data { | |
my $endpoint = URI->new(qq!http://ladio.net/list/!); | |
my $scraper = scraper { | |
process 'div.box-inner li.channel li.title > a', 'result[]' => sub { | |
my $node = shift; | |
my $page = URI->new($node->attr('href')); | |
scraper( | |
sub { | |
process 'div.box-inner div.leftBox table:first-child tr td', 'data[]' => 'TEXT'; | |
result qw/data/; | |
} | |
)->scrape($page); | |
}; | |
}; | |
$scraper->scrape($endpoint); | |
} | |
exit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment