简体   繁体   English

引发 TimeoutException(消息,屏幕,堆栈跟踪)selenium.common.exceptions.TimeoutException:消息

[英]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.

相关问题 TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException: 消息: - TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException: Message: 引发TimeoutException(消息,屏幕,堆栈跟踪)selenium.common.exceptions.TimeoutException:消息:使用Selenium Python - raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException: Message: using Selenium Python 引发 TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException:消息:断言失败 - raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException: Message: Assertion failed raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException: Message: for send whatsapp to all conatcts - raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException: Message: for sending whatsapp to all conatcts 引发TimeoutException(消息,屏幕,堆栈跟踪)selenium.common.exceptions.TimeoutException:消息: - raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException: Message: 元素不可见。 引发TimeoutException(消息,屏幕,堆栈跟踪)selenium.common.exceptions.TimeoutException - Element is not visible. raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException Python selenium:超时异常(消息,屏幕,堆栈跟踪)selenium.common.exceptions.TimeoutException:消息: - Python selenium : TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException: Message: 错误:selenium.common.exceptions.TimeoutException:消息: - error: selenium.common.exceptions.TimeoutException: Message: 消息:selenium.common.exceptions.TimeoutException - Message: selenium.common.exceptions.TimeoutException selenium.common.exceptions.TimeoutException:消息: - selenium.common.exceptions.TimeoutException: Message:
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM