Ashley 0 Posted August 13, 2010 Report Share Posted August 13, 2010 I want my bot do a specific job on the websitebut some times that website is down or very slowhow can i add a time out to my script that if a page didn't load after a specific time it goes to the next step ?or it try later ? Quote Link to post Share on other sites
IRobot 43 Posted August 13, 2010 Report Share Posted August 13, 2010 how can i add a time out to my script that if a page didn't load after a specific time it goes to the next step ?Use the 'navigate' command, set wait to 'No', then use the 'wait finish' command. or it try later ?Put 'navigate' in a loop, with a time delay and a time out. Quote Link to post Share on other sites
Super Dave 26 Posted August 13, 2010 Report Share Posted August 13, 2010 set #nav_url "http://whereiwannago.com" set #search_str "Something specific to the target page" set #nav_timeout "as long as you want to wait" set #max_tries "how many times to try before skipping?" set #is_loaded = 0 set #nav_tries = 0 START while both: #is_loaded = 0 #nav_tries < #max_tries nav #url wait no wait for #search_str timeout #nav_timeout if searchPage(#search_str) set #is_loaded = 1 else inc #nav_tries [ Put a delay in here to wait a certain time before trying again] END while START if not #is_loaded = 0 [do some cool stuff now that the page is loaded] else [page didn't load even though we tried a bunch of times and waited long enough.. put error logging or whatever in this part] END IF As I'm writing this, I'm desperately wishing for an export/print/import feature 2 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.