簡體   English   中英

使用Python Sel登錄Ebay

[英]Logging into Ebay using Python Sel

我正在嘗試使用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")

錯誤是元素不可見:

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

它應該是相當直接的,但我無法弄清楚。 在我遇到的類似問題之前,它與iframe有關。

非常感謝

有兩個元素與給定的XPATH匹配。

請嘗試以下代碼:

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