简体   繁体   English

使用Python Sel登录Ebay

[英]Logging into Ebay using Python Sel

I'm trying to log into ebay using Python Selenium Chromedriver but having some difficulty. 我正在尝试使用Python Selenium Chromedriver登录ebay,但遇到了一些困难。

driver.get("https://signin.ebay.co.uk/ws/eBayISAPI.dll")
driver.maximize_window()

email_address = driver.find_element_by_xpath("//input[@placeholder='Email or username']")
password = driver.find_element_by_xpath("//input[@placeholder='Password']")

email_address.send_keys("email")
password.send_keys("password")

The error is that the element is not visible: 错误是元素不可见:

raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotVisibleException: Message: element not visible

It should be fairly straight forward but I can't figure it out. 它应该是相当直接的,但我无法弄清楚。 On similiar issues I've had before it was something to do with iframes. 在我遇到的类似问题之前,它与iframe有关。

Many thanks 非常感谢

There are two elements matching with the given XPATH. 有两个元素与给定的XPATH匹配。

Try the following code: 请尝试以下代码:

from selenium import webdriver
from selenium.webdriver.common.by import By

driver = webdriver.Chrome();

driver.get("https://signin.ebay.co.uk/ws/eBayISAPI.dll")
driver.maximize_window()

email_address = driver.find_element_by_xpath("//span/input[@placeholder='Email or username']")
password = driver.find_element_by_xpath("//span/input[@placeholder='Password']")

email_address.send_keys("email")
password.send_keys("password")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM