简体   繁体   中英

Selenium web driver stops working while constantly refreshing but doens't time out

driver.get("x.com")
#Wait till page is loaded
try:
    WebDriverWait(driver, 10).until(EC.title_contains("-"))
except TimeoutException:
    print("Timed out.")
finally:

I have a loop that runs this code over and over, getting a new page every couple seconds. It seems after it runs about 7 times it stops wokring as the webdriverwait command doesn't detect the title. However, I dont seem to get the timed out error. Not sure what's going on.

By default, selenium wait for the request before firing the next action. Eg

driver.get("www.x.com") 
driver.findElement("something").click // this action will not trigger until the first action is fired.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM