selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH

selenium.common.exceptions.WebDriverException: Message: ‘geckodriver’ executable needs to be in PATH.

报错的解决办法

Selenium using Python - Geckodriver executable needs to be in PATH

Windows系统解决办法如下:
1、下载geckodriver.exe:
下载地址:https://github.com/mozilla/geckodriver/releases
请根据系统版本选择下载;(如Windows 64位系统)

2、下载解压后将getckodriver.exe复制到Firefox的安装目录下,如(C:\Program Files\Mozilla Firefox),并在环境变量Path中添加路径:C:\Program Files\Mozilla Firefox;

3.重启cmd或IDLE再次运行代码即可

你可能感兴趣的:(Selenium自动化测试)