I am running the following Python code with Selenium:
options = Options()
options.binary_location = r'C:\Program Files\Mozilla Firefox\firefox.exe'
options.set_preference('dom.webnotifications.enabled', False)
options.headless = True
driver = webdriver.Firefox(service=FirefoxService(GeckoDriverManager().install()))
and I have ensured that Firefox is installed on my machine and that the executable is in my PATH.
However, I keep getting the following error:
selenium.common.exceptions.SessionNotCreatedException: Message: Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line