Created
February 18, 2014 11:08
-
-
Save tryperl/9068900 to your computer and use it in GitHub Desktop.
Created by www.tryperl.com.
This file contains hidden or 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
| #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