Anonymous Monk,
With current versions of WWW::Mechanize, autocheck is enabled causing $mech to die in these situations. Here is how you might want to handle it:
eval { $mech->get($url); };
if ($@) {
if ($mech->status == 404) {
# handle page not found
}
else {
die "Mech failed to fetch '$url': $@";
}
}
| [reply] [d/l] |
| [reply] [d/l] |
| [reply] |
| [reply] |
You also might want to switch to WWW::Mechanize::GZip, since some versions of the original WWW::Mechanize seem to announce to handle HTTP compression but don't in reality. This might result in "unparseable" results returned from the webserver.
I doubt this ever happens :) but if it did, the solution is to always install the latest WWW::Mechanize , LWP, Compress::Zlib
If you were going to install WWW::Mechanize::GZip, you might install the latest WWW::Mechanize , LWP, Compress::Zlib instead
| [reply] |
Thanks a bunch, problem solved!
| [reply] |
| [reply] |
Can you show us what you have done so far? | [reply] |