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

Traceback (most recent call last):
  File "/Users/xinxin/PycharmProjects/click/click.py", line 5, in <module>
    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







  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值