perl爬虫收集当前页面所以链接地址,不需要用HTML::LinkExtor模块

2015-12-14 0 182
perl爬虫收集当前页面所以链接地址,不需要用HTML::LinkExtor模块
use LWP::Simple;
use URI::URL;

my @collect_url=();
my $url = "http://pngu.mgh.harvard.edu/~purcell/plink/anal.shtml#model";
my $html = get( $url );

$base= "http://pngu.mgh.harvard.edu/~purcell/plink/";
while ($html =~ m/\"(.*?)\"/ig)#匹配的只是相对地址,需要用绝对地址来修改才能下载
{
   my $new_url = url($1, $base)->abs;
   push @collect_url ,$new_url;
}
   print join("\n", @collect_url), "\n";

遇见资源网 perl perl爬虫收集当前页面所以链接地址,不需要用HTML::LinkExtor模块 http://www.ox520.com/13036.html

上一篇:

已经没有上一篇了!

下一篇:

已经没有下一篇了!

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务