2010-10-22 9 views

Répondre

5

Jetez un oeil à WWW::Mechanize.

code Exemple:

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(); 
} 
3

Utilisation HTML::SimpleLinkExtor:

use strict; 
use warnings; 

use HTML::SimpleLinkExtor; 

my $extor = HTML::SimpleLinkExtor->new(); 
$extor->parse_url('http://example.com/article'); 
my @links = $extor->absolute_links();