<tfoot id='nCrVn'></tfoot>
      • <bdo id='nCrVn'></bdo><ul id='nCrVn'></ul>
        <i id='nCrVn'><tr id='nCrVn'><dt id='nCrVn'><q id='nCrVn'><span id='nCrVn'><b id='nCrVn'><form id='nCrVn'><ins id='nCrVn'></ins><ul id='nCrVn'></ul><sub id='nCrVn'></sub></form><legend id='nCrVn'></legend><bdo id='nCrVn'><pre id='nCrVn'><center id='nCrVn'></center></pre></bdo></b><th id='nCrVn'></th></span></q></dt></tr></i><div id='nCrVn'><tfoot id='nCrVn'></tfoot><dl id='nCrVn'><fieldset id='nCrVn'></fieldset></dl></div>

        <small id='nCrVn'></small><noframes id='nCrVn'>

        <legend id='nCrVn'><style id='nCrVn'><dir id='nCrVn'><q id='nCrVn'></q></dir></style></legend>

        urllib3.exceptions.ProtocolError: ('Connection aborted.&#

        时间:2023-10-08
        1. <small id='TO2YA'></small><noframes id='TO2YA'>

            <i id='TO2YA'><tr id='TO2YA'><dt id='TO2YA'><q id='TO2YA'><span id='TO2YA'><b id='TO2YA'><form id='TO2YA'><ins id='TO2YA'></ins><ul id='TO2YA'></ul><sub id='TO2YA'></sub></form><legend id='TO2YA'></legend><bdo id='TO2YA'><pre id='TO2YA'><center id='TO2YA'></center></pre></bdo></b><th id='TO2YA'></th></span></q></dt></tr></i><div id='TO2YA'><tfoot id='TO2YA'></tfoot><dl id='TO2YA'><fieldset id='TO2YA'></fieldset></dl></div>
            • <bdo id='TO2YA'></bdo><ul id='TO2YA'></ul>
                  <tbody id='TO2YA'></tbody>
              • <legend id='TO2YA'><style id='TO2YA'><dir id='TO2YA'><q id='TO2YA'></q></dir></style></legend>

                • <tfoot id='TO2YA'></tfoot>

                  本文介绍了urllib3.exceptions.ProtocolError: ('Connection aborted.', error(10054, '现有连接被远程主机强行关闭'))的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在尝试使用 Python Selenium chromedriver 在 chrome 上打开一个网站.Chrome 浏览器正在打开(带有警告)并且 url 没有打开.

                  I am trying to open a website on chrome using Python Selenium chromedriver. Chrome browser is opening (with warnings) and the url is not opening.

                  版本详情:Chrome:68.0.3440.106硒:3.14.0铬驱动程序:2.20蟒蛇:2.7

                  Version details : Chrome : 68.0.3440.106 selenium : 3.14.0 chromedriver : 2.20 python : 2.7

                  我正在使用以下代码:

                  import time
                  from selenium import webdriver
                  import selenium
                  driver = webdriver.Chrome("C:/Python27/chromedriver.exe")
                  driver.get("https://vancouver.craigslist.ca/")
                  print(driver.title)
                  time.sleep(8)
                  driver.quit()
                  

                  我遇到以下错误:

                  C:Userssohil7777PycharmProjects	emp.pyvenvScriptspython.exe C:/Users/sohil7777/.PyCharmCE2018.2/config/scratches/scratch.py
                  Traceback (most recent call last):
                    File "C:/Users/sohil7777/.PyCharmCE2018.2/config/scratches/scratch.py", line 6, in <module>
                      driver = webdriver.Chrome("C:/Python27/chromedriver.exe")
                    File "C:Python27libsite-packagesseleniumwebdriverchromewebdriver.py", line 75, in __init__
                      desired_capabilities=desired_capabilities)
                    File "C:Python27libsite-packagesseleniumwebdriver
                  emotewebdriver.py", line 156, in __init__
                      self.start_session(capabilities, browser_profile)
                    File "C:Python27libsite-packagesseleniumwebdriver
                  emotewebdriver.py", line 251, in start_session
                      response = self.execute(Command.NEW_SESSION, parameters)
                    File "C:Python27libsite-packagesseleniumwebdriver
                  emotewebdriver.py", line 318, in execute
                      response = self.command_executor.execute(driver_command, params)
                    File "C:Python27libsite-packagesseleniumwebdriver
                  emote
                  emote_connection.py", line 375, in execute
                      return self._request(command_info[0], url, body=data)
                    File "C:Python27libsite-packagesseleniumwebdriver
                  emote
                  emote_connection.py", line 397, in _request
                      resp = self._conn.request(method, url, body=body, headers=headers)
                    File "C:Python27libsite-packagesurllib3
                  equest.py", line 72, in request
                      **urlopen_kw)
                    File "C:Python27libsite-packagesurllib3
                  equest.py", line 150, in request_encode_body
                      return self.urlopen(method, url, **extra_kw)
                    File "C:Python27libsite-packagesurllib3poolmanager.py", line 322, in urlopen
                      response = conn.urlopen(method, u.request_uri, **kw)
                    File "C:Python27libsite-packagesurllib3connectionpool.py", line 638, in urlopen
                      _stacktrace=sys.exc_info()[2])
                    File "C:Python27libsite-packagesurllib3util
                  etry.py", line 367, in increment
                      raise six.reraise(type(error), error, _stacktrace)
                    File "C:Python27libsite-packagesurllib3connectionpool.py", line 600, in urlopen
                      chunked=chunked)
                    File "C:Python27libsite-packagesurllib3connectionpool.py", line 377, in _make_request
                      httplib_response = conn.getresponse(buffering=True)
                    File "C:Python27Libhttplib.py", line 1121, in getresponse
                      response.begin()
                    File "C:Python27Libhttplib.py", line 438, in begin
                      version, status, reason = self._read_status()
                    File "C:Python27Libhttplib.py", line 394, in _read_status
                      line = self.fp.readline(_MAXLINE + 1)
                    File "C:Python27Libsocket.py", line 480, in readline
                      data = self._sock.recv(self._rbufsize)
                  urllib3.exceptions.ProtocolError: ('Connection aborted.', error(10054, 'An existing connection was forcibly closed by the remote host'))
                  

                  我错过了什么吗?非常感谢您的帮助

                  Am i missing something? Really appreciate your help

                  推荐答案

                  这个错误信息...

                  urllib3.exceptions.ProtocolError: ('Connection aborted.', error(10054, 'An existing connection was forcibly closed by the remote host'))
                  

                  ...暗示 ChromeDriver 无法启动/生成新的 WebBrowserChrome 浏览器 会话.

                  ...implies that the ChromeDriver was unable to initiate/spawn a new WebBrowser i.e. Chrome Browser session.

                  您的主要问题是您使用的二进制文件版本之间的不兼容性,如下所示:

                  Your main issue is the incompatibility between the version of the binaries you are using as follows:

                  • 您正在使用 chromedriver=2.20
                  • chromedriver=2.20 的发行说明明确提及以下内容:

                  支持 Chrome v43-48

                  • 您正在使用 chrome=68.0
                  • ChromeDriver v2.41 明确提及以下内容:
                  • 支持 Chrome v67-69

                    所以 ChromeDriver v2.33Chrome 浏览器 v65.0

                    • ChromeDriver 升级到当前的 ChromeDriverv2.41 级别.
                    • Chrome 版本保持在 Chrome v67-69 级别之间.(根据 ChromeDriver v2.41 发行说明)
                    • 清理你的项目工作区通过你的IDE重建你的项目只需要依赖.
                    • 如果您的基本 Web 客户端 版本太旧,请卸载它并安装最新的 GA 和发布版本的 Web 客户端.
                    • 执行你的 @Test.
                    • Upgrade ChromeDriver to current ChromeDriver v2.41 level.
                    • Keep Chrome version between Chrome v67-69 levels. (as per ChromeDriver v2.41 release notes)
                    • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
                    • If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client.
                    • Execute your @Test.

                    这篇关于urllib3.exceptions.ProtocolError: ('Connection aborted.', error(10054, '现有连接被远程主机强行关闭'))的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何使用 python 在 selenium 的 chrome 驱动程序中加载 下一篇:如何使用 Python 将选项传递给 Selenium Chrome 驱动程

                  相关文章

                  最新文章

                      <legend id='zIDkR'><style id='zIDkR'><dir id='zIDkR'><q id='zIDkR'></q></dir></style></legend>
                    1. <small id='zIDkR'></small><noframes id='zIDkR'>

                        <bdo id='zIDkR'></bdo><ul id='zIDkR'></ul>
                      <tfoot id='zIDkR'></tfoot>
                    2. <i id='zIDkR'><tr id='zIDkR'><dt id='zIDkR'><q id='zIDkR'><span id='zIDkR'><b id='zIDkR'><form id='zIDkR'><ins id='zIDkR'></ins><ul id='zIDkR'></ul><sub id='zIDkR'></sub></form><legend id='zIDkR'></legend><bdo id='zIDkR'><pre id='zIDkR'><center id='zIDkR'></center></pre></bdo></b><th id='zIDkR'></th></span></q></dt></tr></i><div id='zIDkR'><tfoot id='zIDkR'></tfoot><dl id='zIDkR'><fieldset id='zIDkR'></fieldset></dl></div>