This question already has an answer here:
- Unable to find a matching set of capabilities with selenium 3.4.3, firefox 54.0 and gecko driver 0.17 2 answers
- selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities with GeckoDriver, Selenium and Firefox 1 answer
- Selenium WebDriver, Firefox, Centos, unable to find a matching set of capabilities 1 answer
I'm currently trying to set up Selenium for my python script, but I keep getting this error message:
File "/home/{user}/.local/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: Unable to find a matching set of capabilities
I have installed geckodriver v0.18.0, Selenium 3.4.3 Ubuntu Mate and Firefox esr 60.8.0 which all seem to align using the mapping table found here
The error occurs when the webdriver is being initialised:
self.options = webdriver.FirefoxOptions()
try:
ua = UserAgent()
except FakeUserAgentError:
pass
useragent = ua.random
self.options.add_argument(f'user-agent={useragent}')
self.driver = webdriver.Firefox(firefox_options=self.options, executable_path='/usr/local/share/gecko_driver/geckodriver')
and produces this in the geckodriver.log:
1572008446651 geckodriver INFO geckodriver 0.18.0
1572008446669 geckodriver INFO Listening on 127.0.0.1:44093