0

I just built myself a new PC. Was about to go scrape something, but I'm getting the error "Unable to find a matching set of capabilities." No idea why this error is being triggered?

Versions

Windows 10 Home 10.0.18362 Build 18362 (x64)
Firefox 69.0.1 (64-bit) # also tried with the last version of firefox
Python 3.7.4 (64 bit (AMD64))
Selenium 3.141.0
Geckodriver 0.25.0 (64-bit, though I've tried with the 32-bit one and same error)

Stack trace error

File "C:\Users\Anthony\Desktop\ZzzGiants\Scrape\name_dictionary.py", line 30, in create_webdriver_instance
    return webdriver.Firefox()

Script

# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver import Firefox
from selenium.webdriver.firefox.options import Options

def create_webdriver_instance():
    #options = Options()
    #options.add_argument('--headless')
    #return webdriver.Firefox(options=options)
    return webdriver.Firefox()
    """ commented out the options because i was getting this error, but error still persists """

ff = create_webdriver_instance()
...

Rest of stack trace

File "C:\Users\Anthony\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 174, in __init__
    keep_alive=True)
File "C:\Users\Anthony\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
File "C:\Users\Anthony\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
File "C:\Users\Anthony\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
File "C:\Users\Anthony\AppData\Local\Programs\Python\Python37\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
oldboy
  • 5,729
  • 6
  • 38
  • 86
  • https://github.com/SeleniumHQ/selenium/issues/3884 Have you tried all of the solutions in this issue thread on github? – Kraay89 Sep 19 '19 at 08:36
  • 2
    @BugWhisperer Update the question with the error stack trace – undetected Selenium Sep 19 '19 at 08:37
  • @BugWhisperer Does [this](https://stackoverflow.com/questions/54558321/webdriverexception-message-newsession-with-geckodriver-firefox-v65-and-seleniu/54578579#54578579) or [this](https://stackoverflow.com/questions/57461544/sessionnotcreatedexception-message-unable-to-create-new-service-chromedrivers/57464159#57464159) discussion helps you? – undetected Selenium Sep 19 '19 at 11:47
  • @DebanjanB the **CMD Error** is where the stack trace terminates, but I've added some more from the stack trace. Please let me know if you spot anything funny – oldboy Sep 19 '19 at 19:04
  • @Kraay89 No, I hadn't, but I've looked into it and none of that seems to be working. I should have pointed out that I'm using Windows too. – oldboy Sep 19 '19 at 19:18
  • @DebanjanB issue is resolved. refer to my answer on the question – oldboy Sep 19 '19 at 19:38
  • 1
    @Kraay89 issue is resolved. refer to my answer on the question – oldboy Sep 19 '19 at 19:38

1 Answers1

0

The issue was with the Firefox installation. It had been installed in a strange directory initially when Selenium was not working. A simple reinstallation into C:\Program Files\Mozilla Firefox seemed to do the trick.

oldboy
  • 5,729
  • 6
  • 38
  • 86