Created
April 29, 2012 13:33
-
-
Save kenjiskywalker/2550470 to your computer and use it in GitHub Desktop.
JSPORTS_FOOTBALL
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/env perl | |
use strict; | |
use warnings; | |
use LWP::UserAgent; | |
use HTML::TreeBuilder; | |
my $url = "http://www.jsports.co.jp/search/sys/kensaku.cgi?Genre2=02"; | |
my $user_agent = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)"; | |
my $ua = LWP::UserAgent->new('agent' => $user_agent); | |
my $res = $ua->get($url); | |
my $content = $res->content; | |
my $tree = HTML::TreeBuilder->new; | |
$tree->parse($content); | |
my @items = $tree->look_down('id', 'list_contents')->find('dd'); | |
@items = $tree->look_down('id', 'list_contents')->find('td') ; | |
print $_->as_text."\n" for @items; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment