可以扩展Selenium的默认TimeoutException吗?
我的脚本在页面加载超过300秒时崩溃。我的脚本在后端触发了一个php脚本。如果php脚本运行不到300秒,一切都很好,但是当脚本运行更长时间时,selenium会抛出TimeoueException错误。
TimeoutException: Message: timeout:从渲染器接收消息时超时: 300.000
有没有一种方法可以让Selenium一直等到脚本运行完毕?
我已经尝试过expected_conditions,但它不起作用。
发布于 2020-11-14 22:14:41
嘿,也许这可以解决你的问题
from selenium.webdriver.support import expected_conditions as EC
wait = WebDriverWait(driver, 10)
element = wait.until(EC.element_to_be_clickable((By.ID, 'someid')))它将等待,直到提到的按钮可点击。
https://stackoverflow.com/questions/64823692
复制相似问题