利用python3+selenium3+chrome 59.0.3053.3做自动化测试时,打开chrome报错 20

一下是详细信息Traceback(mostrecentcalllast):File"D:/JOY/Project/selenium_test/testSB_TDk.py"... 一下是详细信息Traceback (most recent call last): File "D:/JOY/Project/selenium_test/testSB_TDk.py", line 10, in setUp self.driver.maximize_window() File "D:\Users\luoqiao\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 553, in maximize_window self.execute(command, {"windowHandle": "current"}) File "D:\Users\luoqiao\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 236, in execute response = self.command_executor.execute(driver_command, params) File "D:\Users\luoqiao\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 415, in execute return self._request(command_info[0], url, body=data) File "D:\Users\luoqiao\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 447, in _request resp = self._conn.getresponse() File "D:\Users\luoqiao\AppData\Local\Programs\Python\Python36\lib\http\client.py", line 1331, in getresponse response.begin() File "D:\Users\luoqiao\AppData\Local\Programs\Python\Python36\lib\http\client.py", line 297, in begin version, status, reason = self._read_status() File "D:\Users\luoqiao\AppData\Local\Programs\Python\Python36\lib\http\client.py", line 258, in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") File "D:\Users\luoqiao\AppData\Local\Programs\Python\Python36\lib\socket.py", line 586, in readinto return self._sock.recv_into(b)ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。 展开
 我来答
机智出品
2017-04-01
知道答主
回答量:23
采纳率:0%
帮助的人:9万
展开全部
#可以试试这段代码能不能用,我这边和你配置一样,是可以开的
from selenium import webdriver
bb = webdriver.Chrome()
bb.get('https://www.baidu.com/')
bb.implicitly_wait(10)
print(bb.title)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式