Jump to content
UBot Underground

What's the best way to [wait]?


Recommended Posts

How do you wait in your code?

 

I tried "Wait for browser event" in my script and noticed that at times it wasn't enough. Certain commands didn't work until I put an additional "wait 3 seconds" before them.

 

How do you approach your wait steps? What's the best way?

 

Do you use:

 

Wait for browser event

Wait for element

Wait

 

Or a combination?

 

Edited by Lucas
Link to post
Share on other sites

I do "wait for element" most always. But I choose something on the bottom of the page and use inner text<<<important or submit button and use innertext when ever possible.

 

navigate("http://www.ubotstudio.com/resources""Wait")
wait for element(<innertext="Our Blog">"""Appear")

 

or choose the last element that you need.

  • Like 1
Link to post
Share on other sites

I do "wait for element" most always. But I choose something on the bottom of the page and use inner text<<<important or submit button and use innertext when ever possible.

 

navigate("http://www.ubotstudio.com/resources""Wait")

wait for element(<innertext="Our Blog">"""Appear")

 

or choose the last element that you need.

 

I agree, i use that "wait for element" all the time.

Can't go wrong with that one.

Link to post
Share on other sites

So damn glad I asked this question.

 

I coded up my first script...I tested it in individual pieces which worked perfectly. I'm the boss I thought. I'm gonna rule the internet. But when I ran the nodes together the whole process (which formerly worked in pieces) broke repeatedly and I couldn't understand why. I used 'wait for browser event' still in a few places, and it was still breaking at different points for no clear reason. I didn't expect the type of waiting to be such a script breaking issue.

 

Wait for element is what finally made the statements work as I expected. 

 

Waiting is a big deal

Edited by Lucas
Link to post
Share on other sites

definitely wait for element, and then the actual element that your first then going to be dealing with is great, and usually i would put a 60 second time out. Straight after i normally put an IF to say that if the element doesn't exist then run the command again, until the element does exist.

Link to post
Share on other sites

definitely wait for element, and then the actual element that your first then going to be dealing with is great, and usually i would put a 60 second time out. Straight after i normally put an IF to say that if the element doesn't exist then run the command again, until the element does exist.

Interesting. In my code I assume that if the element doesn't exist the website has changed in some way and I need to examine it manually. So after the wait for element (with just a 5 second time out) I have an IF which stops the script with an error if the element does not exist.

 

I guess it depends on the site though... If it's a site I own and control then I might do it a bit like your way. I imagine you have a set number of iterations?

Link to post
Share on other sites

With the boom in jquery on web sites, I don't even bother with anything other then the wait for element command. I'll normally select something on the page below where I'm automating and it works 100%. Why? Simple, javascript and jquery can dynamically change the page after it's totally loaded. I write jquery for some e-carts and I use this functionality to change the cart look and feel after the cart provider loads the page.

 

Frank

Link to post
Share on other sites

I use the wait for element command, it also keeps your bot on track when applied correctly. Make sure that the element you are waiting for is quinue to the page. I also use the wait for browser event, eveything loaded in some cases after navigating.

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...