#!perl use strict; use warnings; use WWW::Mechanize; use HTML::TokeParser; my @todo = 'http://intranet'; my %seen = (@todo, 1); my $mech = WWW::Mechanize->new( keep_alive => 1 ); $mech->credentials('intranet:80','','CORP\\williami','censored'); while (my $url = shift @todo) { print "Visiting: $url\n"; $mech->get( $url); for ($mech->links) { my $link = $_->url_abs; push @todo, $link unless exists $seen{$link}; $seen{$link}++; } my $text = $mech->content; my $tp = HTML::TokeParser->new(\$text); while (my $tag = $tp->get_tag('img')) { print "Found image: ", $tag->[1]{src}, "\n"; } }