Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use HTML::LinkExtor; use LWP::Simple qw(get head); $base_url = shift or die "not working here: $0 <start_url>\n"; $parser = HTML::LinkExtor->new(undef, $base_url); $parser->parse(get($base_url)); @links = $parser->links; print "$base_url: \n"; foreach $linkarray(@links) { my @element = @$linkarray; my $elt_type = shift @element; while (@element) { my ($attr_name, $attr_value) = splice(@element, 0,2); if ($attr_value->scheme =~ /\b(ftp|https?|file)\b/) { print " $attr_value ", head($attr_value) ? "OK" : "BAD","\n"; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Script is accurate 80% of time
by Zaxo (Archbishop) on Mar 27, 2002 at 16:56 UTC | |
by belg4mit (Prior) on Mar 27, 2002 at 18:23 UTC | |
|
(crazyinsomniac) Re: Script is accurate 80% of time
by crazyinsomniac (Prior) on Mar 28, 2002 at 09:04 UTC | |
|
Case sensitive regex problem?
by RMGir (Prior) on Mar 27, 2002 at 11:55 UTC |