[问题解决] Selenium+PhantomJS使用时报错原因及解决方案

萝らか妹 提交于 2019-12-04 23:16:21

在做动态网页爬虫时用到了selenium + PhantomJS,安装好之后运行时报错:

E:\Python3\python.exe F:/PyCharmWorkspace/MessageBoom/TestPhantomjs.py
E:\Python3\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 '

Process finished with exit code 0

说是 Selenium 已经弃用 PhantomJS ,请使用火狐或者谷歌无界面浏览器。

查找之后得到答案时selenium的版本问题,使用pip show selenium显示默认安装的是 3.12.0版本

· 卸载之后重新pip install selenium==2.48.0安装成功

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!