#### #!/usr/bin/perl -w use URI; use Web::Scraper; use Encode; # First, create your scraper block my $p1 = scraper { process 'table[class="dextable"] td[class="cen"]', "list[]" => scraper { # And, in each td, # get the URI of "a" element process_first "a", uri => '@href'; # get text inside "u" element process_first "a", name => '@title'; }; }; my $res = $p1->scrape( URI->new("http://serebii.net/duel/figures.shtml") ); for my $p (@{$res->{list}}) { print Encode::encode("utf8", "$p->{name}\t$p->{uri}\n"); }
ID No. Picture Pokémon Name Rarity Movement Material Cost
ID - 26 Poliwag Poliwag C 3 250