from selenium.webdriver.support import expected_conditions as EC 解析


from selenium.webdriver.support import expected_conditions as EC 解析

expected_conditionsSelenium的一个模selenium.webdriver.support.expected_conditions,可以对网页上元素是否存在,可点击等等进行判断,一般用于断言或与WebDriverWait配合使用。

例如

from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC


wait = WebDriverWait(self.driver,20)
wait.until(EC.presence_of_element_located((By.XPATH,'//div[@id="root"]')))#等到啥时候为止


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM