0

I'm try to run the selenium python package in Debian 9 Stretch for web-scraping purposes; I installed such versions for the following softwares:

  1. Python 2.7.13 (with Pycharm 2018.2 Community Edition)
  2. Mozilla Firefox Quantum 61.0.1 (64 bit)
  3. Selenium 3.14 (with GeckoDriver v0.21.0)

When I try to call the web driver by running:

driver = webdriver.Firefox(executable_path="/home/quant/Documenti/Executable/geckodriver")

I get the following error message in the python console:

Traceback (most recent call last): File "", line 1, in File "/home/quant/Scrivania/BettingDataDownload/venv/lib/python3.5/site-packages/selenium/webdriver/firefox/webdriver.py", line 167, in init keep_alive=True) File "/home/quant/Scrivania/BettingDataDownload/venv/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 156, in init self.start_session(capabilities, browser_profile) File "/home/quant/Scrivania/BettingDataDownload/venv/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 251, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "/home/quant/Scrivania/BettingDataDownload/venv/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 320, in execute self.error_handler.check_response(response) File "/home/quant/Scrivania/BettingDataDownload/venv/lib/python3.5/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

What's wrong?

The path of the executable is correct and the file is executable; moreover, by adding the firefox_binary option to the webdriver.Firefox function as follows:

driver = webdriver.Firefox(firefox_binary="/snap/bin/firefox", executable_path="/home/quant/Documenti/Executable/geckodriver")

one gets the same error shown above.

Any help or suggestion will be appreciated. Thanks all.

QuantumGorilla
  • 583
  • 2
  • 10
  • 25
  • Maybe Firefox isn't installed in the default path. Try to pass the Firefox path in the keyworded argument **firefox_binary** in Firefox initialization. You may find useful the documentation: https://selenium-python.readthedocs.io/api.html#module-selenium.webdriver.firefox.webdriver – Federico Rubbi Sep 09 '18 at 06:38
  • Thanks for the comment @FedericoRubbi and the link! anyway, by adding the firefox binary option to the webdriver.Firefox function as follows: driver = webdriver.Firefox(firefox_binary="/snap/bin/firefox",executable_path="/home/quant/Documenti/Executable/geckodriver") I get the same error!! :( I got the path by running which firefox in the terminal.. any advice?? – QuantumGorilla Sep 09 '18 at 09:47
  • The path should be: "/snap/bin/firefox.exe" – Federico Rubbi Sep 09 '18 at 09:49
  • No way! always the same error.. anyway, I think that the .exe format should be used on windows OS only, right? – QuantumGorilla Sep 09 '18 at 09:53
  • Oh, my bad. I thought you were in Windows. Have you tried to add the entire filename of the Firefox file? – Federico Rubbi Sep 09 '18 at 09:55
  • What do you mean @FedericoRubbi? how can I do that? – QuantumGorilla Sep 09 '18 at 11:19
  • Checkout this discussion https://stackoverflow.com/questions/44601126/unable-to-find-a-matching-set-of-capabilities-with-selenium-3-4-3-firefox-54-0 – undetected Selenium Sep 10 '18 at 14:10
  • Hi @Newcontributor and thanks for the comment! Anyway, no way.. it gives the same error :( – QuantumGorilla Sep 12 '18 at 21:32

0 Answers0