Jump to content
UBot Underground

Time out for your codes.


Recommended Posts

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.
Link to post
Share on other sites

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

  • Like 2
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...