安装selenium遇到Unable to find a matching set of capabilities问题

Traceback (most recent call last):
  File "/Users/xinxin/PycharmProjects/click/click.py", line 5, in 
    driver = webdriver.Firefox(executable_path='/Users/xinxin/geckodriver')
  File "/Users/xinxin/click/lib/python2.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 162, in __init__
    keep_alive=True)
  File "/Users/xinxin/click/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 154, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "/Users/xinxin/click/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 243, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/Users/xinxin/click/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 312, in execute
    self.error_handler.check_response(response)
  File "/Users/xinxin/click/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities
今天遇到一个很有意思的问题,安装selenium的时候遇到
Unable to find a matching set of capabilities

在网上查阅的时候,大部分是说可能是Firefox版本不匹配问题。在确认版本还算新的情况下:

python 2.7

selenium 3.11.0

geckodriver v0.20.0

Firefox 59.0.1

后来上stackoverflow发现有人提到,需要把Firefox安装在Applications里面,且不能更改命名,如Firefox58,我之前放在本地文件夹里,试着重新安装了一下成功了。

粘贴一下stackoverflow地址

https://stackoverflow.com/questions/43713445/selenium-unable-to-find-a-matching-set-of-capabilities-despite-driver-being-in


安装selenium遇到Unable to find a matching set of capabilities问题_第1张图片





你可能感兴趣的:(python,报错)