Test:
Get all links from a page and display their text and url addresses
Solution:
my $m = WWW::Mechanize->new();
$m->get( "http://www.google.com/" );
@arr=$m->links;
$count=1;
foreach (@arr)
{
print "link $count--";
$count++;
print $_->text."\n\t".$_->url."\n\n" ;
}

No comments:
Post a Comment