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:
- selenium.common.exceptions.WebDriverException: Message: unknown Error: cannot find Chrome binary
- Mac environment and python + selenium environment are built to solve the error reporting problem of chromedriver
- Chromedriver executable needs to be in path [How to Solve]
- How to Solve centos7 selenium–unknown error: DevToolsActivePort file doesn’t exist
- [Solved] Chrome Version Error: Message: session not created: This version of ChromeDriver only supports Chrome version 95
- Message: ‘geckodriver’ executable needs to be in PATH. [Solved]
- [Solved] Appium Error: selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Can’t stop process; it’s not currently runni…
- selenium.common.exceptions.WebDriverException: Message: ‘geckodriver’ executable needs to…
- Error reporting in Firefox using selenium in Python
- USB: usb_device_handle_win.cc:1056 Failed to read descriptor from node connection