Beefy Boxes and Bandwidth Generously Provided by pair Networks
Frank "be consistent"  How do I parse links out of a web page
( #13054=categorized question: print w/ replies, xml ) Need
Help?? Contributed by Anonymous Monk on May 18, 2000 at
20:28 UTC Q&A  > HTTP and FTP clients   I'm trying to parse all
the links in a web page into an array organized like this:
($link, $description) where: <a href="">Come <b>visit</b> my
<u>we +b page</u>!</a> gets parsed into: $link = "" $description
= "Come visit my web page!" thanks very much for the help!
Answer: 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 = ""; 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"; } Answer: How do I parse links out of a web page
contributed by gregorovius  Un