ConnectionResetError: [WinError 10054] 远程主机强迫关闭了

利用python selenium 搞自动化测试  在打开Google浏览器时抛出这个异常 


C:\Users\think\AppData\Local\Programs\Python\Python35\python.exe F:/Python/test.py
Traceback (most recent call last):
  File "F:/Python/test.py", line 7, in <module>
    browser.get("http://www.yahoo.com") # Load page
  File "C:\Users\think\AppData\Local\Programs\Python\Python35\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 268, in get
    self.execute(Command.GET, {'url': url})
  File "C:\Users\think\AppData\Local\Programs\Python\Python35\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 254, in execute
    response = self.command_executor.execute(driver_command, params)
  File "C:\Users\think\AppData\Local\Programs\Python\Python35\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 464, in execute
    return self._request(command_info[0], url, body=data)
  File "C:\Users\think\AppData\Local\Programs\Python\Python35\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 488, in _request
    resp = self._conn.getresponse()
  File "C:\Users\think\AppData\Local\Programs\Python\Python35\lib\http\client.py", line 1174, in getresponse
    response.begin()
  File "C:\Users\think\AppData\Local\Programs\Python\Python35\lib\http\client.py", line 282, in begin
    version, status, reason = self._read_status()
  File "C:\Users\think\AppData\Local\Programs\Python\Python35\lib\http\client.py", line 243, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "C:\Users\think\AppData\Local\Programs\Python\Python35\lib\socket.py", line 571, in readinto
    return self._sock.recv_into(b)
ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。


需要下载最新版本的chromedriver.exe,比如 2.27,就可以正常打开了。

  • 5
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 5
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值