Created
June 7, 2010 01:16
-
-
Save fujiwara/428095 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
use strict; | |
use Web::Scraper; | |
use LWP::UserAgent; | |
use Encode; | |
my $s = scraper { process "#topicsfb li" => "topics[]" => "TEXT" }; | |
$s->user_agent( LWP::UserAgent->new( agent => "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)" ) ); | |
my $r = $s->scrape( URI->new("http://www.yahoo.co.jp") ); | |
print encode_utf8($_), "\n" for @{ $r->{topics} }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment