显示等待:WebDriverWait()
WebDriverWait(driver,timeout,poll_frequency=0.5,ignored_exceptions=None)
1
需要通过from selenium.webdriver.support.wait import WebDriverWait导入模块
driver:浏览器驱动
timeout:最长超时时间,默认以秒为单位
poll_frequency:检测的间隔步长,默认为0.5s
ignored_exceptions:超时后的抛出的异常信息,默认抛出NoSuchElementExeception异常。