Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by initself (Monk)
on Feb 06, 2006 at 05:40 UTC ( [id://528156]=perlquestion: print w/replies, xml ) Need Help??

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://528156]
Approved by monkfan
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (2)
As of 2024-04-26 07:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found