· 在做动态网页爬虫时用到了selenium + PhantomJS,安装好之后运行时报错:
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 ' |
查找之后得到答案时selenium的版本问题,使用pip show selenium显示默认安装的是3.8.1版本
· 卸载之后重新pip install selenium==2.48.0安装成功
专门写出来这个版本号是因为我使用2.0.0安装报错
error: package directory 'build\src\py\test' does not exist ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in C:\Users\OLD_DR~1\AppData\Local\Temp\pip-build-vqjzohmy\selenium\ |
之后运行爬虫没有报错,搞定!!!
上文内容不用于商业目的,如涉及知识产权问题,请权利人联系博为峰小编(021-64471599-8017),我们将立即处理。