selenium+phantomjs 报错解决,不支持phantomjs的解决

selenium+phantomjs 报错解决,不支持phantomjs的解决

执行如下程序


c:\Python37\python.exe d:/Py/crawler/Phantomjs.py

报错:

c:\Python37\lib\site-packages\selenium\webdriver\phantomjs\webdriver.py:49: UserWarning: Selenium support for PhantomJS has been deprecated, please use headless versions of Chrome or Firefox instead
  warnings.warn('Selenium support for PhantomJS has been deprecated, please use headless '
pip show selenium

Process finished with exit code 0

分析原因:selenium放弃对新版本phantomjs的支持了

因为已经进入维护状态了

如果想继续使用该功能

先执行删除新版本
pip uninstall selenium

再安装指定版本
pip install selenium==2.48.0