As mentioned by others before, turn off autocheck.
#!/usr/bin/perl use strict; use warnings; use WWW::Mechanize; my $browser = WWW::Mechanize->new( stack_depth => 0, # Turn off memory consuming history timeout => 180, # Set timeout in seconds autocheck => 0, # Turn off autocheck, check errors m +anually ); $browser->agent_alias( 'Windows IE 6' ); my $url = 'https://foo.bar/page.html'; $browser->get($url); if ( $browser->success( ) ) { print "Okay: $url. ", $browser->response->status_line(), "\n"; } else { print "Error: $url. Reason: ", $browser->response->status_line(), +"\n"; }
Run the script with autocheck turned on (1) to reproduce your errormessage.
Hope this helps.
Thomas
In reply to Re: Crashing WWW:Mech test script if page not found
by tomfahle
in thread Crashing WWW:Mech test script if page not found
by talexb
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |