http://qs321.pair.com?node_id=528156

initself has asked for the wisdom of the Perl Monks concerning the following question:

I interface WWW::Mechanize with a website that is notoriously slow and buggy and crappy. Sometimes, requests for pages take absolutely forever to get a reply, but when you press back on the browser and resubmit the request, the request will go through immediately.

I wanted to simulate that on WWW::Mechanize - determine how long I have been timed out in my request and if x number of seconds pass, use $mech->back and resubmit my request.

Anyone know if this is possible?

  • Comment on WWW::Mechanize - resubmit after a certain amount of time has passed

Replies are listed 'Best First'.
Re: WWW::Mechanize - resubmit after a certain amount of time has passed
by jbrugger (Parson) on Feb 06, 2006 at 06:15 UTC
    You could time your request using WWW::Mechanize::Timed, and use autocheck =>1 to see if a request was good or not.

    If you want to check the time / status self, you'd could use Time::HiRes.
    You can simulate a back button using $mech->back().

    "We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.