[英]raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException: Message
i get this error when i'm trying to access the login page in flickr "raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException: Message"当我尝试访问 flickr 中的登录页面时出现此错误“引发 TimeoutException(消息,屏幕,堆栈跟踪)selenium.common.exceptions.TimeoutException:消息”
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait as wait
from selenium.webdriver.support import expected_conditions as EC
driver = webdriver.Chrome(executable_path="C:\\chromedriver.exe")
driver.get("https://www.flickr.com/")
driver.maximize_window()
wait = WebDriverWait (driver, 10)
element = wait.until(EC.element_to_be_clickable((By.XPATH, "//a[@id='yui_3_16_0_1_1619317268956_93511']")))
element.click()
No element located by //a[@id='yui_3_16_0_1_1619317268956_93511']
xpath
is presented on https://www.flickr.com/
home page. //a[@id='yui_3_16_0_1_1619317268956_93511']
xpath
没有找到元素出现在https://www.flickr.com/
主页上。
You should use //a[contains(@href,'signin')]
instead您应该改用
//a[contains(@href,'signin')]
If your target is the login
button, please use the bellow css selector:如果您的目标是
login
按钮,请使用下面的 css 选择器:
element = wait.until(EC.element_to_be_clickable((By.CSS_SELECTOR, "a[href*='signin']")))
But if you still want use xpath, the suggest @Prophet is right.但是如果你仍然想使用 xpath,建议@Prophet 是对的。
But note css selector more faster than xpath.但请注意 css 选择器比 xpath 更快。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.