Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Answer: How do I parse links out of a web page

by tokpela (Chaplain)
on Jun 24, 2006 at 06:34 UTC ( #557357=categorized answer: print w/replies, xml ) Need Help??

Q&A > HTTP and FTP clients > How do I parse links out of a web page - Answer contributed by tokpela

Or you can use WWW::Mechanize
use strict; use warnings; use WWW::Mechanize; my $url = "file:///D:/webpage.html"; #my $url = ""; my $mech = WWW::Mechanize->new(); $mech->get( $url ); my @links = $mech->links(); foreach my $link (@links) { print "LINK: " . $link->url() . "\n"; print "DESCRIPTION: " . $link->text() . "\n"; }

Log In?

What's my password?
Create A New User
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2016-10-21 09:46 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (288 votes). Check out past polls.