-1
我正在尋找一種方式來從一個網頁,並輸出到一個文本文件中刮的URL。 E.g如果頁面包含多個http://example.com/article
我想抓住這兩個網址,並輸出到一個文本文件中。尋找一種方式來颳去一個頁面,其輸出的URL到一個文本文件
我正在尋找一種方式來從一個網頁,並輸出到一個文本文件中刮的URL。 E.g如果頁面包含多個http://example.com/article
我想抓住這兩個網址,並輸出到一個文本文件中。尋找一種方式來颳去一個頁面,其輸出的URL到一個文本文件
看一看WWW::Mechanize。
示例代碼:
use strict;
use warnings;
use 5.010;
use WWW::Mechanize;
my $mech = WWW::Mechanize->new();
$mech->get('http://example.com/example');
foreach my $link ($mech->find_all_links()) {
say $link->url_abs();
}
use strict;
use warnings;
use HTML::SimpleLinkExtor;
my $extor = HTML::SimpleLinkExtor->new();
$extor->parse_url('http://example.com/article');
my @links = $extor->absolute_links();
你是怎麼發現,當你試圖在這個網站搜索是什麼? – Ether 2010-10-22 00:36:31