#!/usr/bin/perl --
use strict;
use warnings;
use WWW::Mechanize;
my $mech_cgi = WWW::Mechanize->new ( autocheck => 1 );
$mech_cgi->show_progress(1);
$mech_cgi->get( 'http://www.molmovdb.org/cgi-bin/browse.cgi' );
my @Motion = $mech_cgi->find_all_links( url_regex => qr/motion.cgi/ );
@Motion = map { $_->url_abs() } @Motion;
for my $link ( @Motion ){
eval {
$mech_cgi->get( $link );
1;
} or warn $@, "\n", $mech_cgi->res->as_string, "\n", '#'x33, "\n\n
+";
$mech_cgi->back;
}
__END__
And you'll get something more informative
** GET http://www.molmovdb.org/cgi-bin/browse.cgi ==> 202 OK
...
** GET http://..../4040404 ==> 404 Not Found
Error GETing http://..../4040404: Not Found at somefile.pl line 12
HTTP/1.1 404 Not Found
Connection: close
Date: Thu, 13 Oct 2011 23:01:51 GMT
...
Content-Length: 3942
Content-Type: text/html
Client-Date: Thu, 13 Oct 2011 23:05:18 GMT
...
Title: blah blah blah
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
....
|