Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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

by tokpela (Chaplain)
on Jun 24, 2006 at 06:34 UTC ( [id://557357]=note: print w/replies, xml ) Need Help??


in reply to How do I parse links out of a web page

Or you can use WWW::Mechanize
use strict; use warnings; use WWW::Mechanize; my $url = "file:///D:/webpage.html"; #my $url = "http://www.domain.com/webpage.html"; 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?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://557357]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-25 13:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found