原因是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)

相关文章:

  • 2021-10-10
  • 2022-12-23
  • 2021-09-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-03
  • 2021-09-08
猜你喜欢
  • 2021-06-08
  • 2021-09-08
  • 2021-05-24
  • 2021-10-21
  • 2021-09-08
相关资源
相似解决方案