gpt4 book ai didi

python - Selenium ChromeDriver ssl_client_socket_impl.cc(941) 握手失败

转载 作者:太空宇宙 更新时间:2023-11-03 19:44:20 25 4
gpt4 key购买 nike

我目前在企业控制环境下使用 Windows 32 位的 Python3.7 和 Chrome 版本 80.0.3987.100。它实际上使用选定的用户配置文件打开 Chrome,但 DevTools 无法建立连接,因此代码在导航到选定的 URL 之前被中断。我已经检查了 ChromeDriver 的版本是否正确。

我的实际代码:

from selenium import webdriver

woptions = webdriver.ChromeOptions()
woptions.add_argument("--user-data-dir=C:\\Users\\xxx\\AppData\\Local\\Google\\Chrome\\User Data2")
woptions.add_argument("--profile-directory=pySelenium")
woptions.add_argument("--disable-popup-blocking")
woptions.add_argument("--disable-default-apps")
woptions.add_argument("--disable-dev-shm-usage")
woptions.add_argument("--disable-gpu")
woptions.add_argument("-no-sandbox")
woptions.add_argument("--disable-infobars")
woptions.add_argument("--dns-prefetch-disable")
woptions.add_argument("--disable-extensions")
woptions.add_argument("--disable-notifications")
woptions.add_argument("--ignore-certificate-errors-spki-list")
woptions.add_argument("--ignore-certificate-errors")
woptions.add_argument("--ignore-ssl-errors")
woptions.add_argument("--allow-insecure-localhost")
woptions.add_argument("--ignore-urlfetcher-cert-requests")
woptions.add_experimental_option('useAutomationExtension',False)

w = webdriver.Chrome(options=woptions)
w.Navigate().GoToUrl("http://www.uol.com.br")

错误消息:

[12532:12892:0214/160407.330:ERROR:ssl_client_socket_impl.cc(941)] handshake failed; returned -1, SSL error code 1, net_error -101

接下来是我认为源自此错误的其他错误。

看来我必须以某种方式处理 SSL 证书,而不是仅仅试图忽略它,但我迷路了。

最佳答案

我正在使用 Selenium、python 和 Chrome80。我注意到这些“ssl错误代码1”与一些控制台错误同时出现,这与Chrome中的一些弃用有关。您可能想检查您的控制台,看看它是否也发生在您身上

enter image description here

关于python - Selenium ChromeDriver ssl_client_socket_impl.cc(941) 握手失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60232329/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com