Newbie here: WebDriverException: Message: unknown error: cannot find Chrome binary

Viewed 162

Im a total noob, and Ive been trying to fix this issue for 2 days now and always get stuck. Im trying to get chromedriver running through anaconda in JupyterLab. Any advice on this issue?

wd = wd.Chrome()
wd.implicitly_wait(10)

Gives me this error:

WebDriverException: Message: unknown error: cannot find Chrome binary

I understand the issue, but I have had no succsess with several attempts at fixing it; as said Im a total beginner and lack in basic knowledge, so any detailed help would be greatly appreciated.

1 Answers

It's needed to provide path to the chrome binary, e.g. in following way:

from selenium import webdriver 

# create selenium driver
chrome_options = webdriver.ChromeOptions()
#chrome_options.add_argument('--headless')
#chrome_options.add_argument('--no-sandbox')
driver = webdriver.Chrome('<PATH_TO_CHROMEDRIVER>', options=chrome_options)

# open web page
driver.get('<URL>')

# quit driver
#driver.quit() 

Executable can be downloaded here. Selenium tutorial for python is available here.

Related