By常量),第二项是定位器的值:
from selenium.webdriver.common.by import Byfrom selenium.webdriver.support.ui import WebDriverWaitfrom selenium.webdriver.support import expected_conditions as ECwait = WebDriverWait(browser, 10)wait.until(EC.presence_of_element_located((By.XPATH, '//*[@id="hplogo"]')))
请注意,您的情况
By.ID会更简单:
wait.until(EC.presence_of_element_located((By.ID, 'hplogo')))
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)