zingbust has asked for the wisdom of the Perl Monks concerning the following question:
....where $link is a WWW::Mechanize::Link object, I found that occasionaly it would hang up if the URL was invalid and my program would stop working. Because of this, it was suggested that I change my code so that it now reads like this....$m->get($link);
....and this seemed to do the trick. However, after getting a few hundred valid URLs, all of a sudden, even this way of constructing it failed to move on when a perfectly valid link was found as follows... http://www.aaaedm.com/contact.htm ....this particular link was found by a previous fetch using the get method. If you try to go to that URL in IE, nothing unusual happens, yet my $m->get just doesn't work at all, hanging up the program at that point, even though there's nothing at all wrong with that URL. Can anyone tell me why $m->get fails for this particular web address after previously working correctly on hundreds of other URLs? Since I have about 10,000 more to go through, I assume the same problem is going to happen again. Perhaps if I knew why it was happening, I could come up with some sort of solution. thanks!my $connected = eval { $m->get($link); 1 }; if (! $connected) { #do something else }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: WWW::Mechanize get doesn't work
by GrandFather (Saint) on Mar 22, 2012 at 00:01 UTC | |
by Anonymous Monk on Mar 22, 2012 at 03:16 UTC | |
by GrandFather (Saint) on Mar 22, 2012 at 03:29 UTC | |
by Anonymous Monk on Mar 22, 2012 at 06:33 UTC | |
|
Re: WWW::Mechanize get doesn't work
by choroba (Cardinal) on Mar 21, 2012 at 22:27 UTC |