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

在运行程序的时候报了这个错误,说明我的驱动位置不对,我使用的Mac 我在我的根目录下面输入chrom在使用tab键可以补全,但是运行就报这个错误,说明我的路径确实不对。然后输入

which chromedriver 

显示地址

/usr/local/bin/chromedriver

由于权限问题,我就没有制定这个目录,使用命令

 cd /usr/local/bin
sudo mv chromedriver ~

把驱动移动到了根目录。然后在运行就可以了。

原文地址:https://www.cnblogs.com/liangliangzz/p/10391725.html