【发布时间】:2016-11-16 15:09:59
【问题描述】:
我在 Firefox 和 IE 上获得了 selenium 工作,但我还不能在 Chrome 上工作:S
这是我的代码(只是为了检查):
from selenium import webdriver
driver = webdriver.Chrome()
driver.get('https://www.google.com')
问题是Chrome打开窗口但卡住后,既没有进入网页,我收到这个错误:
Traceback(最近一次调用最后一次):文件 “C:/Users/Carlo/Desktop/CEx/src/IE.py”,第 21 行,在 driver.get('https://www.google.com') 文件 "C:\Python35-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", 第 248 行,在获取 self.execute(Command.GET, {'url': url}) 文件 "C:\Python35-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", 第 234 行,执行中 response = self.command_executor.execute(driver_command, params) 文件 “C:\Python35-32\lib\site-packages\selenium\webdriver\remote\remote_connection.py”,第 407 行,在执行中 return self._request(command_info[0], url, body=data) 文件“C:\Python35-32\lib\site-packages\selenium\webdriver\remote\remote_connection.py”,第 439 行,在 _request resp = self._conn.getresponse() 文件“C:\Python35-32\lib\http\client.py”,第 1197 行,在 getresponse response.begin() 文件“C:\Python35-32\lib\http\client.py”,第 297 行,开始 版本、状态、原因 = self._read_status() 文件“C:\Python35-32\lib\http\client.py”,第 258 行,在 _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") File "C:\Python35-32\lib\socket.py", line 575, in readinto return self._sock.recv_into(b) ConnectionResetError: [WinError 10054] 现有连接被远程主机强行关闭
问题是我没有打开任何其他连接:S,当它打开页面顶部的 chrome 窗口时,我收到了这个:
您正在使用不受支持的命令行标志: --忽略证书错误。稳定性和安全性将受到影响。
我真的相信这会导致硒不起作用,但我没有做对!请帮忙?!?!?!?!
【问题讨论】:
标签: python windows selenium selenium-chromedriver