Wait for element to be clickable using python and Selenium

前端 未结 3 1510
隐瞒了意图╮
隐瞒了意图╮ 2021-01-25 04:54

There are ways to wait for an object e.g. a button to be clickable in selenium python. I use time.sleep() and/or WebDriverWait...until, it works fine.<

3条回答
  •  忘了有多久
    2021-01-25 05:22

    is there a way to set a default time lag globally, instead of implementing it on each object?

    Yes, that's exactly what setting an Implicit Wait does. The implicit wait is used for the life of the WebDriver.

    example:

    driver.implicitly_wait(10)

    info:

    • https://www.seleniumhq.org/docs/04_webdriver_advanced.jsp#implicit-waits

提交回复
热议问题