Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Simple link extraction tool-another way

by Scott7477 (Chaplain)
on Jan 04, 2007 at 00:27 UTC ( [id://592850]=note: print w/replies, xml ) Need Help??


in reply to Simple link extraction tool

After consulting with merlyn and brian d foy, I came up with this:
use strict; use HTML::SimpleLinkExtor; use LWP::Simple; #usage linkextractor http://www.example.com > output.txt my $url = shift; my $content = get ($url); my $extor = HTML::SimpleLinkExtor->new(); $extor->parse($content); my @all_links = $extor->links; foreach my $elem (@all_links) { print $elem."\n"; }
Update:: HTML::SimpleLinkExtor comes with a script linktractor that gets the job done just fine as well.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2024-04-19 15:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found