Skip to content

Instantly share code, notes, and snippets.

@fujiwara
Created June 7, 2010 01:16
Show Gist options
  • Save fujiwara/428095 to your computer and use it in GitHub Desktop.
Save fujiwara/428095 to your computer and use it in GitHub Desktop.
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