splinter,selenium 找不到chromedriver

xiaoxiao2021-02-28  189

使用splinter, chromedriver 放在当前目录是可以找到的. 放在其他目录就找不到了. 设置系统路径也不行. 报错如下:

selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

解决方法:

增加 executable_path 参数即可:

from splinter import Browser

browser = Browser(driver_name='chrome', executable_path='../chromedriver')

转载请注明原文地址: https://www.6miu.com/read-17435.html

最新回复(0)