chromedriverUnable to obtain driver for chrome using ,selenium找不到chromedriver

avatar
作者
猴君
阅读量:0

1、下载chromedriver

chromedriver下载网址:CNPM Binaries Mirror

老版本在:chromedriver/

较新版本在:chrome-for-testing/

 2、设置了环境变量还是找不到chromedriverUnable to obtain driver for chrome using 

NoSuchDriverException: Message: Unable to obtain driver for chrome using Selenium Manager

方法:

第一种:chromedriver.exe复制文件放入python安装目录的Scripts文件夹中

例如:C:\Users\***\AppData\Local\Programs\Python\Python38\Scripts

第二种:带上路径执行

from selenium import webdriver from selenium.webdriver.chrome.service import Service  # Add service service = Service(executable_path=r"C:\Users\***\chromedriver.exe") options = webdriver.ChromeOptions() driver = webdriver.Chrome(service=service, options=options) driver.get('https://www.baidu.com') driver.quit()

广告一刻

为您即时展示最新活动产品广告消息,让您随时掌握产品活动新动态!