geckodriver-v0.18.0-macos.tar.gz
在使用Selenium 3.x驱动Firefox浏览器时,如果报错信息如下: selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH. 这是因为在Firefox高版本需要使用 geckodriver 来驱动,不再使用Selenium默认自带的Firefox webdriver。 另外这也是Selenium 3.x更新以后,出现的问题。我们只需要在下面这个地址下载 geckodriver 并将其所在的路径设为环境变量即可解决。 1、下载geckodriver 下载路径: https://github.com/mozilla/geckodriver/releases 2、把解压后的geckodriver,放在 /usr/bin/ 路径下 (PS:一定要放在这个路径下,被这个问题坑了半小时了,~~~~(>_<)~~~~) 3、修改path环境变量, #打开环境变量文件 sudo vi ~/.bash_profile #添加配置项 export PATH=$PATH:/usr/bin/geckodriver #重启生效配置项 source ~/.bash_profile