I wanted to run a webdriver against a website and benefit from the automatic download of Selenium Manager on the way. If I use the recommended way to get a driver (namely calling webdriver.Chrome()), I get an error (see below).
Traceback (most recent call last):
File "/cygdrive/e/test/src/./install_chrome.py", line 14, in <module>
driver = webdriver.Chrome()
^^^^^^^^^^^^^^^^^^
File "/cygdrive/e/test/src/.venv/lib/python3.12/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in __init__
super().__init__(
File "/cygdrive/e/test/src/.venv/lib/python3.12/site-packages/selenium/webdriver/chromium/webdriver.py", line 55, in __init__
self.service.start()
File "/cygdrive/e/test/src/.venv/lib/python3.12/site-packages/selenium/webdriver/common/service.py", line 106, in start
self._start_process(self._path)
File "/cygdrive/e/test/src/.venv/lib/python3.12/site-packages/selenium/webdriver/common/service.py", line 221, in _start_process
self.process = subprocess.Popen(
^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/subprocess.py", line 1026, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.12/subprocess.py", line 1955, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\me\\.cache\\selenium\\chromedriver\\win64\\146.0.7680.165\\chromedriver.exe'
Description
I wanted to run a webdriver against a website and benefit from the automatic download of Selenium Manager on the way. If I use the recommended way to get a driver (namely calling
webdriver.Chrome()), I get an error (see below).I could solve it by copying
chromedriver.exefrom its default location to the current directory but still I'd rather use the recommended way.Reproducible Code
Debugging Logs