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

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()

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值