Test:
Given a keyword, find all url having that keyword
Solution:
my $m = WWW::Mechanize->new();
$m->get( "http://www.google.com/" );
my @links = $m->find_all_links(
tag => "a", text_regex => qr/history/i );
foreach(@links)
{
$tmp=$_->text;
print "$tmp\n";
$tmp=$_->url;
print "$tmp\n";
}

No comments:
Post a Comment