简体   繁体   English

无法通过 Selenium 和 Python 使用 ChromeDriver 和 Chrome 登录 ebay 帐户

[英]Unable to signin into ebay account using ChromeDriver and Chrome through Selenium and Python

I am trying to run this code to print labels for things that have sold on ebay:我正在尝试运行此代码来打印在 ebay 上出售的东西的标签:

from selenium import webdriver
from selenium.webdriver.common.keys import Keys

PATH = "C:\src\chromedriver.exe"
driver = webdriver.Chrome(PATH)
driver.get("https://www.ebay.co.uk/sh/ord/?filter=status%3AAWAITING_SHIPMENT")


title = driver.title
if title == "Sign in or Register | eBay":
    username = driver.find_element_by_id("userid")
    username.send_keys("username")
    username.send_keys(Keys.RETURN)

However, the username does not get submitted in the text box and i can see errors in chromedriver.exe:但是,用户名没有在文本框中提交,我可以在 chromedriver.exe 中看到错误:

[9496:19816:0710/133749.738:ERROR:ssl_client_socket_impl.cc(959)] handshake failed; returned -1, SSL error code 1, net_error -200
[9496:19816:0710/133751.420:ERROR:ssl_client_socket_impl.cc(959)] handshake failed; returned -1, SSL error code 1, net_error -100
[9496:19816:0710/133751.433:ERROR:ssl_client_socket_impl.cc(959)] handshake failed; returned -1, SSL error code 1, net_error -100
[1716] shell_ipc_client.cc:116:Connect Can't connect to socket at: \\.\Pipe\GoogleDriveFSPipe_User_shell

How do i fix this and why is this happening?我该如何解决这个问题,为什么会这样?

Edit: This is only the sign in part of my program, i still have to find a way to print the labels.编辑:这只是我程序的一部分,我仍然需要找到一种方法来打印标签。

I made some simple tweaks to your code and here are is the observation:我对您的代码进行了一些简单的调整,以下是观察结果:

  • Code Block:代码块:

     driver.get("https://www.ebay.co.uk/sh/ord/?filter=status%3AAWAITING_SHIPMENT") WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//label[@for='userid']"))).send_keys("question_boi")
  • Browser Snapshot:浏览器快照:

ebay_recaptcha


Deep Dive深潜

When I accessed the DOM Tree of the website https://www.ebay.co.uk/sh/ord/?filter=status%3AAWAITING_SHIPMENT it was observed eBay signin page contains a script which detects Selenium driven ChromeDriver initiated Browsing Context and user is navigated to the verification page.当我访问网站https://www.ebay.co.uk/sh/ord/?filter=status%3AAWAITING_SHIPMENTDOM 树时,观察到eBay登录页面包含一个检测Selenium驱动的ChromeDriver启动浏览的脚本上下文和用户被导航到验证页面。

ebay_recaptcha_dom

Hence you see the error.因此,您会看到错误。

暂无
暂无

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

相关问题 SessionNotCreatedException:此版本的 ChromeDriver 仅支持 Chrome 版本 84 使用 ChromeDriver 和 Chrome 通过 Selenium 和 Python - SessionNotCreatedException: This version of ChromeDriver only supports Chrome version 84 using ChromeDriver and Chrome through Selenium and Python 无法通过 Python 中的 Selenium 杀死 Chrome 进程并使用 ChromeDriver 和 Chrome 耗尽内存 - Unable to kill Chrome process and running out of memory with ChromeDriver and Chrome through Selenium in Python chromedriver 不再运行,因此 ChromeDriver 假设 Chrome 使用 Selenium 到 Python 发生崩溃错误 - chromedriver is no longer running, so ChromeDriver is assuming that Chrome has crashed error using Selenium through Python selenium.common.exceptions.WebDriverException: Message: invalid session id using Selenium with ChromeDriver and Chrome through Python - selenium.common.exceptions.WebDriverException: Message: invalid session id using Selenium with ChromeDriver and Chrome through Python selenium.common.exceptions.NoSuchElementException:消息:没有这样的元素:无法使用带有Python的Selenium ChromeDriver Chrome找到元素 - selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element using Selenium ChromeDriver Chrome with Python selenium.common.exceptions.WebDriverException: 消息:无法通过 Selenium Python 使用 ChromeDriver Chrome 连接到服务错误 - selenium.common.exceptions.WebDriverException: Message: Can not connect to the Service error using ChromeDriver Chrome through Selenium Python 无法使用 Selenium、Python 和 ChromeDriver 访问元素 - Unable to access the element using Selenium , Python and ChromeDriver 将Selenium与ChromeDriver和Chrome通过Python结合使用时,“连接异常中止”,ConnectionResetError(104,“对等连接重置”) - 'Connection aborted.', ConnectionResetError(104, 'Connection reset by peer') using Selenium with ChromeDriver and Chrome through Python 如何通过Python使用ChromeDriver Chrome和Selenium在页面上打印类别链接? - How to print the the category links on a page using ChromeDriver Chrome and Selenium through Python? 使用Selenium ChromeDriver中的ChromeOptions和通过Python的Chrome,“选项”对象没有属性“ set_preference”错误 - 'Options' object has no attribute 'set_preference' error using ChromeOptions in Selenium ChromeDriver and Chrome through Python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM