
根据您的代码试用,您可以删除
time.sleep(30)并诱使 WebDriverWait 使其可点击,如下所示:
from selenium.webdriver.support.ui import WebDriverWaitfrom selenium.webdriver.common.by import Byfrom selenium.webdriver.support import expected_conditions as EC# lines of preWebDriverWait(driver, 30).until(EC.element_to_be_clickable((By.ID, "proceed"))).click()
注意* :根据用例,以最大时间限制配置 WebDriverWait 实例。该元素 可见 并 启用后
,该expected_conditions
方法element_to_be_clickable()
将返回 WebElement
,以便您可以单击它。 ***
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)