Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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

( #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 contributed by tokpela

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"; }

Comment on Answer: How do I parse links out of a web page
Download Code
Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2014-12-25 13:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (160 votes), past polls