解决Python3配置常见错误 selenium3

第一个坑:’geckodriver’ executable needs to be in PATH

这个是因为最新的selenium3.0启动firefox需要geckodriver.exe这个驱动文件;

下载之后,配置到环境变量path下(可以直接放python根目录)。

第二坑:Expected browser binary location, but unable to find binary in default location

这个是因为firefox.exe这个文件也需要配置到环境变量path下;

这个路径就是安装完firefox后,找到firefox.exe这个文件的地址,加到path下。

第三坑:Unsupported Marionette protocol version 2, required 3

这个错误原因是firefox版本过低了,最新的selenium3.0版本支持firefox47以上的版本,升级版本就可以了。

第四坑:WebDriverException: Message: newSession

下载最新的geckodriver.exe 然后把它放到python的安装目录下。

posted @ 2021-08-23 15:20  黑色盒子  阅读(140)  评论(0编辑  收藏  举报