折腾:
【已解决】Selenium出错:Message unknown error Element button is not clickable at point
期间,需要在Selenium的Python中,判断某个网页的等待的新图层消失不可见,再继续后面动作。
通过之前看过的:
5. Waits — Selenium Python Bindings 2 documentation
invisibility_of_element_located
-》
7. WebDriver API — Selenium Python Bindings 2 documentation
selenium.webdriver.support.expected_conditions.invisibility_of_element_located(locator)
Bases: object
An Expectation for checking that an element is either invisible or not present on the DOM.
locator used to find the element
然后去试试:
【总结】
最后用代码:
busyContainerElementInvisible = WebDriverWait(driver, gCfg[“waitTimeout”] * 2).until(EC.invisibility_of_element_located(
(By.XPATH, ‘//section[contains(@class, “busyContainer”)]’)))
# wait from:
# <section style=”display: block;” id=”ember593″ class=”busyContainer ember-view x-hidden-focus”>
# to:
# <section style=”display: none;” id=”ember593″ class=”busyContainer ember-view x-hidden-focus”>
即可。
转载请注明:在路上 » 【已解决】Selenium中如何判断等到某个元素消失不可见