- 在做動態(tài)網頁爬蟲時用到了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 已經棄用 PhantomJS ,請使用火狐或者谷歌無界面瀏覽器。
查找之后得到答案時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\
之后運行爬蟲沒有報錯,搞定!!!