我正在使用:
在python shell中:
from selenium import webdriver
driver = webdriver.Firefox()
偶尔失败,有时会失败,有时失败 这是错误跟踪:
Traceback (most recent call last):
File "<input>", line 1, in <module>
driver = webdriver.Firefox()
File "..../lib/python3.5/site-packages/selenium/webdriver/firefox/webdriver.py",
line 152, in __init__
keep_alive=True)
File "..../lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py",
line 98, in __init__
self.start_session(desired_capabilities, browser_profile)
File "..../lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py",
line 188, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "..../lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py",
line 250, in execute
response = self.command_executor.execute(driver_command, params)
File "..../lib/python3.5/site-packages/selenium/webdriver/remote/
remote_connection.py", line 464, in execute
return self._request(command_info[0], url, body=data)
File "..../lib/python3.5/site-packages/selenium/webdriver/remote/
remote_connection.py", line 488, in _request
resp = self._conn.getresponse()
File "..../.pyenv/versions/3.5.2/lib/python3.5/http/client.py",
line 1197, in getresponse
response.begin()
File "..../.pyenv/versions/3.5.2/lib/python3.5/http/client.py",
line 297, in begin
version, status, reason = self._read_status()
File "..../.pyenv/versions/3.5.2/lib/python3.5/http/client.py",
line 266, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response