Created
October 30, 2008 09:24
-
-
Save mattn/20947 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/bin/perl | |
use strict; | |
use warnings; | |
use Web::Scraper; | |
use URI; | |
use YAML; | |
my $airlines_accident_scraper = scraper { | |
process '//div[@class="entry-content"]//table/tr', | |
'airlines[]' => scraper { | |
process '//td[1]', title => 'TEXT'; | |
process '//td[2]', last_accident => 'TEXT'; | |
process '//td[3]', flight_count => 'TEXT'; | |
process '//td[4]', death_accident => 'TEXT'; | |
process '//td[5]', death_rate => 'TEXT'; | |
process '//td[6]', accident_incidence => 'TEXT'; | |
process '//td[7]', total_rank => 'TEXT'; | |
}; | |
result 'airlines'; | |
}; | |
my $list = $airlines_accident_scraper->scrape(URI->new('http://www.manji.com/jp/2007/08/post_22.html')); | |
use YAML; | |
warn Dump $list; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment