The reason is that selenium cannot find the browser (note that this is the path of the browser, not the path of the webdriver
), so you need to specify the path of the browser. The specific operations are as follows:
rom selenium import webdriver
url = 'https://www.google.com'
options = webdriver.ChromeOptions()
# key point
options.binary_location = "D:\Google\Chrome\Application\chrome.exe"
driver = webdriver.Chrome(executable_path="D:\chromedriver_win\chromedriver.exe", options=options)
driver.get(url)