Skip to content

Instantly share code, notes, and snippets.

@JEEN
Created March 2, 2009 05:38
Show Gist options
  • Save JEEN/72628 to your computer and use it in GitHub Desktop.
Save JEEN/72628 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use Web::Scraper;
use URI;
use LWP::Simple;
my $content = scraper {
process 'div[id="Wa_talktalk_main1_pnBlogIt"]',
"data" => scraper {
process 'a', 'url[]' => '@href';
};
result 'data';
}->scrape(URI->new("http://www.aladdin.co.kr/shop/wproduct.aspx?ISBN=8925510111&start=we"));
my $data;
foreach my $url (@{ $content->{url} }) {
next if $url =~ /(?:aladdin|naver)/;
$data = $url;
}
my $res = get($data);
my ($ttb) = $res =~ /href="(http:\/\/.+?ttbkey[^"]+)"/;
print $ttb;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment