selenium失败了几次启动firefox

时间:2017-05-02 08:36:59

标签: python selenium-webdriver geckodriver

我正在使用:

  • FireFox 53.0(64位)
  • selenium 3.4.1
  • geckodriver-v0.16.1-linux64(位于〜/ .local / bin /,位于我的$ PATH中)

在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

0 个答案:

没有答案