Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 R selenium 中,可以像这样设置时间睡眠:
Sys.sleep(15)
如何设置随机时间?在python中是这样的:
time.sleep(random.uniform(3.5,6.9))
Sys.sleep(sample(1:10, 1))
应该解决问题
在 Java Selenium 2.x 中,您可以使用Sleeper.sleepTight(randomDurationInMS). 您可能可以访问 R 绑定中的同一个 Sleeper 类。
Sleeper.sleepTight(randomDurationInMS)
我认为 Selenium 3.0(当它最终问世时)会摆脱那个类,但也许有什么东西会取代它。