Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to obtain working Selenium Manager binary

When running the most basic selenium script it causes the error -

selenium.common.exceptions.WebDriverException: Message: Unable to obtain working Selenium Manager binary; C:\Users\User\.conda\envs\InstaScraper\Lib\site-packages\selenium\webdriver\common\windows\selenium-manager.exe

I can see both selenium and selenium-manager are installed with conda list with version 4.16.0

When I checked that file path provided, there is no windows folder.

Script run:

from selenium import webdriver

driver=webdriver.Chrome()

driver.get("https://www.selenium.dev/selenium/web/web-form.html")

1 Answers

I got the same error ("Unable to obtain working Selenium Manager binary"), but in my case the problem is that I'm on Ubuntu, and apparently Selenium Manager is not yet packaged for Debian/Ubuntu. (See /usr/share/doc/python3-selenium/README.Debian) Instead, you need to explicitly tell Selenium the path to the driver, via a Service object.

More particularly, for me (using python3 to drive firefox), the fix was:

from selenium import webdriver
from selenium.webdriver.firefox.service import Service
firefox_service = Service(executable_path="/snap/bin/geckodriver")
driver = webdriver.Firefox(service = firefox_service)

(I realize this doesn't apply the OP's situation, but maybe it'll help someone else who lands on this page.)

like image 113
Michael Dyck Avatar answered Oct 27 '25 04:10

Michael Dyck