首次使用selenium webdriver,报错selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
Windows处理方法:
1、下载geckodriver.exe:
下载地址:https://github.com/mozilla/geckodriver/releases
根据系统版本选择下载;(如Windows 64位系统)
2、下载解压后将getckodriver.exe复制到Firefox的安装目录下(firefox图标右键-属性-打开文件位置),并在环境变量Path中添加firefox的路径:C:\Program Files\Mozilla Firefox;
3.再次运行代码