Oct-04-2024, 04:29 PM
I have a script that used to work with Python 2 and I have upgraded to Python 3. I have been going in circles trying different suggestions for solving my problem but nothing has worked. I get the 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
Here is my current attempt:
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
Here is my current attempt:
.
.
.
from selenium import webdriver
from selenium.webdriver.firefox.service import Service
from selenium.webdriver.firefox.options import Options as FirefoxOptions
.
.
.
options=FirefoxOptions()
service=Service(r"c:\cygwin64\geckodriver.exe")
options.add_argument("-headless")
driver=webdriver.Firefox(service=service,options=options)Can someone help me through this? TIA.
