Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Simple link extraction tool-another way

by Scott7477 (Chaplain)
on Jan 04, 2007 at 00:27 UTC ( #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
Node Status?
node history
Node Type: note [id://592850]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2021-06-19 20:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (93 votes). Check out past polls.

    Notices?