Selenium Error: Message: unknown error: cannot find Chrome binary

The reason is that selenium cannot find the browser (note that this is the path of the browser, not the path of webdriver), so you need to specify the path of the browser as follows:

from selenium import webdriver

url = ‘ https://www.baidu.com ‘
options = webdriver.ChromeOptions()

#Here is the key
options.binary_location = “D:\Google\Chrome\Application\chrome.exe”

driver = webdriver.Chrome(executable_path=”D:\chromedriver_win\chromedriver.exe”, options=options)
driver.get(url)

Similar Posts: