Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Message:Unable to obtain chromedriver using Selenium Manager

I've tried writing this code on my jupyter notebook, and it shows me the error. My objective is to carry out web scrapping.

driver = webdriver.Chrome(ChromeDriverManager().install())

enter image description here

I've also installed selenium using pip and webdriver-manager using pip as well.

like image 854
Vedant Joshi Avatar asked Sep 16 '25 12:09

Vedant Joshi


1 Answers

The output of ChromeDriverManager().install() is an executable_path to the driver, but executable_path was removed in selenium 4.10.0. That's why you're seeing the error after passing the value into webdriver.Chrome(). Here are the changes: https://github.com/SeleniumHQ/selenium/commit/9f5801c82fb3be3d5850707c46c3f8176e3ccd8e

Changes_in_selenium_4_10_0

Note that executable_path was removed. If you want to pass in an executable_path, you'll have to use the service arg now. (service=Service(executable_path='./chromedriver')) But Selenium Manager is now fully included with selenium 4.10.0, so this is all you need:

from selenium import webdriver
from selenium.webdriver.chrome.service import Service

service = Service()
options = webdriver.ChromeOptions()
driver = webdriver.Chrome(service=service, options=options)
# ...
driver.quit()

If the driver isn't found on your system PATH, Selenium Manager will automatically download it for you.

like image 102
Michael Mintz Avatar answered Sep 19 '25 01:09

Michael Mintz