gpt4 book ai didi

r - 如何检查页面是否在 RSelenium 中完成加载

转载 作者:行者123 更新时间:2023-12-04 11:59:49 25 4
gpt4 key购买 nike

想象一下,您使用 RSelenium 单击一个元素。在页面上,并希望从结果页面中检索结果。如何检查以确保结果页面已加载?我可以插入 Sys.sleep()在处理页面和单击元素之间,但这似乎是一种非常丑陋且缓慢的做事方式。

最佳答案

套装ImplicitWaitTimeout然后在页面上搜索一个元素。来自 ?remoteDriver

setImplicitWaitTimeout(milliseconds = 10000)

Set the amount of timethe driver should wait when searching for elements. When searching fora single element, the driver will poll the page until an element isfound or the timeout expires, whichever occurs first. When searchingfor multiple elements, the driver should poll the page until at leastone element is found or the timeout expires, at which point it willreturn an empty list. If this method is never called, the driver willdefault to an implicit wait of 0ms.

关于r - 如何检查页面是否在 RSelenium 中完成加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27080920/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com