1

I know this is a duplicate of previously asked questions. But I cannot for the life of me get this to work. I've added it to my path. I've set the executable path. I've tried multiple versions of the driver. Still the same error. Wondering if anyone can provide me their version of python, selenium and the geckodriver, and firefox? Is firefox even needed? I've had it working before, like a year ago, but now it's not working. Thanks.

My versions:

Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 22:39:24) [MSC v.1916 32 bit (Intel)] on win32
selenium        3.141.0
geckodriver     0.26.0

Code:

driver = webdriver.Firefox(executable_path = r"C:\Users\nbrei\Documents\GitHub\scraper\geckodriver.exe")

Traceback

Traceback (most recent call last):
  File "eps_insider_gatherer.py", line 12, in <module>
    driver = webdriver.Firefox(executable_path = r"C:\Users\nbrei\Documents\GitHub\quarterly_earnings\geckodriver.exe")
  File "C:\Users\nbrei\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 170, in __init__
    RemoteWebDriver.__init__(
  File "C:\Users\nbrei\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "C:\Users\nbrei\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "C:\Users\nbrei\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Users\nbrei\AppData\Local\Programs\Python\Python38-32\lib\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
nicholas.reichel
  • 2,260
  • 7
  • 20
  • 28

3 Answers3

0

Change the value for the Key executable_path as follows:

driver = webdriver.Firefox(executable_path = r'C:\Users\nbrei\Documents\GitHub\scraper\geckodriver.exe')

You can find a couple of relevant discussions in:

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
0

Be sure you have the correct geckodriver.exe file in your python path. In particular if the system expects the 64-bit version and you have the 32-bit version installed, this would be one cause the "unable to find a matching set of capabilities" error.

0

I ran into the same problem and it turned out that I didn't have firefox available in my $PATH as I used a tar-archive to install it. So, make sure Firefox is found and can be started by Selenium/geckodriver.

jnns
  • 5,148
  • 4
  • 47
  • 74