在使用python的Selenium库模拟浏览器完成抓取遇到的问题。
最先开始我使用的版本:
selenium:3.141
Firefox:66(这个我记不太清楚了。查看Firefox版本,打开Firefox->Alt->帮助->关于Firefox)
geckodriver:v0.24.0(下载地址:https://github.com/mozilla/geckodriver/releases)
出现问题:
Message: 'geckodriver' executable needs to be in PATH.
后来我把Firefox换成:51.0.1 (下载地址:http://www.pc6.com/softview/SoftView_41795.html)
出现问题:
selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities
我把geckodriver:v0.24.0换成了geckodriver:v0.15.0,问题得到解决。
最终:
selenium:3.141
Firefox:51.01(下载地址:http://www.pc6.com/softview/SoftView_41795.html)
geckodriver:v0.15.0(下载地址:https://github.com/mozilla/geckodriver/releases)
成功运行。