0

I am trying to run selenium python script using selenium V4.7.2 on Firefox. I am on windows 11 64 bit.

Chrome is running without using WebDriverManager with the below mentioned code -

from selenium import webdriver
driver = webdriver.Chrome()
driver.maximize_window()
driver.get("https://www.wikipedia.org/")

But when running through Firefox, It is throwing me an error when using the below code -

from selenium import webdriver
driver = webdriver.Firefox()
driver.maximize_window()
driver.get("https://www.wikipedia.org/")

Error is -

"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"

My firefox is the latest version i.e, 108.0.1 and GeckDriver version is 0.32.0

Firefox is installed in the default location i.e, "C:\Program Files\Mozilla Firefox"

Any help is highly appreciated. Stuck here since a week.

I have tried re-installing firefox. Also tried adding GeckoDriver.exe in System path. (Environment variable) Also my geckdriver version is 64 bit same as my laptop's config.

I am able to run through Firefox using WebDriverManager, but in the latest version of Selenium 4.6.0 there is no need to import WebDriverManager, that's why was trying to run without WebDriverManager.

If anyone could provide me with the solution that would be helpful.

  • Have you try the solution provided in below link? https://stackoverflow.com/questions/65318382/expected-browser-binary-location-but-unable-to-find-binary-in-default-location – Sadha Nanda Dec 28 '22 at 05:37

0 Answers0