Perl WWW::Mechanize exits on 503 Service Unavailable -
i using perl's www::mechanize send http traffic site. returns 503 service unavailable error result of http request sent site.
the problem script dies after receiving error. not want happen , instead script should continue execution. want ignore error.
$mech=www::mechanize->new(); $mech->agent_alias('windows ie 6'); $mech->get($url); // code after not execute print $mech->content(); how can configure www::mechanize ignore http response code 503 , continue execution?
thanks.
my $mech = www::mechanize->new( onerror => undef ); $mech->get($url); if (!$mech->success()) { die("$url: ".$mech->res->status_line()); } print $mech->content(); replace die whatever action want have take instead.
Comments
Post a Comment