selenium报错Message: unknown error: cannot find Chrome binary

原因是selenium找不到浏览器(注意,这里是浏览器的路径,不是webdriver的路径),所以需要指定一下浏览器的路径,具体操作如下:

from selenium import webdriver

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

# 这里是关键
options.binary_location = "D:\Google\Chrome\Application\chrome.exe"


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

原文地址:https://www.cnblogs.com/qiaoer1993/p/15531046.html