如何添加等待/延迟,直到将网页完全加载到Automation Anywhere中? [英] How to add wait / Delay until web page is fully loaded in Automation Anywhere?

查看:343
本文介绍了如何添加等待/延迟,直到将网页完全加载到Automation Anywhere中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在任何地方的自动化系统中了解如何添加等待时间或延迟直到网页完全加载", 我用

I want to know 'How to add wait or Delay until webpage is fully loaded,' in automations anywhere, I used

等待屏幕切换

wait for screen change

但是它会保留该过程直到开发人员指定的某个时间,但是我想增加延迟,直到网页完全加载为止, 有没有人可以帮助我? 对不起,英语不好.

But it hold the process until some time specified by the developer , but I want to add delay until the web page fully loaded, Is there anyone can help me? sorry for the bad English.

推荐答案

通常,在加载实际内容之前,网站已加载"或就绪".有些网站甚至包含伪造的内容,一旦从某处"检索到实际内容,这些伪造的内容就会被替换.因此,等待屏幕更改不是一个好主意.

Usually, a website is "loaded" or "ready" before the actual content is loaded. Some websites even have dummy content which is replaced once the actual content is retrieved from 'somewhere'. Hence waiting for the screen to change is not a good idea.

我的方法是在要与之交互的元素之后选择一个要加载的元素.例如,该网站上的导航栏在评论之前被加载.您可以通过右键单击任意位置并选择view source来查看网站的source,从而找出要使用的元素,或者只需刷新页面几次并加以关注即可.前者需要一些HTML知识,但是我认为这是一种更好的方法.

My approach is to pick an element which you know is loaded after the element you want to interact with. For instance the navigation bar on this website is loaded before the comments are. You can either figure out which element to use by looking at the source of the website by right-clicking anywhere and selecting view source or by simply refreshing the page a couple of times and eye-balling it. The former requires some HTML knowledge, but is a better approach in my opinion.

一旦确定了元素,请在该元素上使用Object Cloning并使用内置的wait作为延迟(通常设置为15秒,具体取决于网站/连接). Action应该是一些随机的get property(将您检索到的所有内容存储在某个虚拟变量中,因为我们无论如何都不会使用它.)

Once you've identified your element, use Object Cloning on said element and use the built-in wait as a delay (usually set to 15 sec, depending on the website/connection). The Action should be some random get property (store whatever you retrieve in some dummy variable as we're not going to use it anyway).

Object Cloning的等待函数每隔毫秒轮询一次,一旦找到该元素,它将几乎立即转到代码的下一行.这是您与目标元素进行交互的地方.

Object Cloning's wait function polls every so many milliseconds and once the element is found it will almost instantaneously go to the next line in the code. This is where you interact with your target element.

这样,您知道,目标元素已加载,代码非常优化且健壮.

This way you know your target element is loaded and the code is very optimized and robust.

最后一点:通常,将其与一些异常处理结合在一起是一个好主意,因为自动化网站容易出错.

On a final note: It's usually a good idea to surround this with some exception handling as automating websites is prone to errors.

这篇关于如何添加等待/延迟,直到将网页完全加载到Automation Anywhere中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆