Skip to content

Instantly share code, notes, and snippets.

@tryperl
Created February 18, 2014 11:08
Show Gist options
  • Save tryperl/9068900 to your computer and use it in GitHub Desktop.
Save tryperl/9068900 to your computer and use it in GitHub Desktop.
Created by www.tryperl.com.
#Created by tryperl.com
use strict;
use warnings;
use URI;
use Web::Scraper;
print "Hello World!\n";
my $uri = "http://price.pcauto.com.cn/26037/news0.html";
my $scraper = scraper {
process "a[href]", "urls[]" => '@href';
result 'urls';
};
my $links = $scraper->scrape(URI->new($uri));
use YAML;
warn Dump $links;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment