UserWarning: Selenium support for PhantomJS has been deprecated, please use headless versions of Chr
2018-03-07 22:38
776 查看
In [1]: from selenium import webdriver In [2]: driver = webdriver.PhantomJS() G:\Anaconda3\lib\sitepackages\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 ' In [3]: quit()
报错的意思大概是
Selenium 已经弃用 PhantomJS ,请使用火狐或者谷歌无界面浏览器
查看selenium版本
C:\Users\zty>pip show selenium Name: selenium Version: 3.10.0 Summary: Python bindings for Selenium Home-page: https://github.com/SeleniumHQ/selenium/ Author: UNKNOWN Author-email: UNKNOWN License: Apache 2.0 Location: g:\anaconda3\lib\site-packages Requires:
原来目前默认安装的selenium版本为3.x
百度查得 安装2.x版本可解决此问题
so:
C:\Users\zty>pip uninstall selenium C:\Users\zty>pip install selenium==2.48.0 Collecting selenium==2.48.0 Downloading selenium-2.48.0.tar.gz (805kB) 100% |████████████████████████████████| 808kB 5.1kB/s Building wheels for collected packages: selenium Running setup.py bdist_wheel for selenium ... done Stored in directory: C:\Users\zty\AppData\Local\pip\Cache\wheels\5a\80\e9\7317945f05740b625382070b69cbccb2f37a00af0d95d4e428 Successfully built selenium Installing collected packages: selenium Successfully installed selenium-2.48.0 C:\Users\zty>ipython Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 10:22:32) [MSC v.1900 64 bit (AMD64)] Type 'copyright', 'credits' or 'license' for more information IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help. In [1]: from selenium import webdriver In [2]: driver = webdriver.PhantomJS()
问题解决
相关文章推荐
- 【Python】UserWarning: Selenium support for PhantomJS has been deprecated, please use headless version
- warn: Appium support for versions of node < 0.12 has been deprecated and will be removed in a future
- 出现 Assigning the return value of new by reference is deprecated in xxxx &&“Warning: Call-time pass-by-reference has been deprecated”怎么办?
- [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_ti
- Setting the background color on UITableViewHeaderFooterView has been deprecated. Please use contentV
- The maximum number of apps for free development profiles has been reached.
- lnmp/lamp-- 解决Warning: scandir() has been disabled for security reasons in…的问题
- Warning: Call-time pass-by-reference has been deprecated的解决办法
- 未通过针对是否适用于 Firefox的验证 现已被禁用 could not be verified for use in Firefox and has been disabled
- sql 2005 Login failed for user '登录名'. Reason: The password of the account has expired.
- This function ereg_replace() has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged
- This app has been built with an incorrect configuration. Please configure your build for VectorDra
- powerpivot 2013 已超出每个用户的最大允许会话数 The maximum numberof allowed sessions for each user has exceeded
- This app has been built with an incorrect configuration. Please configure your build for VectorDrawa
- Warning: Call-time pass-by-reference has been deprecated的解决办法
- 解决docker WARNING: Usage of loopback devices is strongly discouraged for production use的正确姿势
- 全网最详细使用Scrapy时遇到0: UserWarning: You do not have a working installation of the service_identity module: 'cannot import name 'opentype''. Please install it from ..的问题解决(图文详解)
- 【ask】Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral.
- Registration has not been run for all of the FEAT directories
- 关于 Warning: Call-time pass-by-reference has been deprecated解决方法