selenium python 报错“ unable to find binary in default location”

selenium python 报错如下;

raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line

3个步骤可以解决:

1. 下载最新的geckodriver(firefox的第三方驱动),放在一个目录,将此目录加入环境变量的PATH.

2. .将你的firefox的安装路径加入环境变量PATH并重启电脑)

原文地址:https://www.cnblogs.com/ellie-test/p/6674328.html