PhantomJS报错warnings.warn('Selenium support for PhantomJS has been deprecated, please use headless '
原因:Selenuim已经放弃PhantomJS3.x了,建议使用火狐或者谷歌无头浏览器。
解决方法:
1.phantomjs降级,换个2.x版本的
2.使用无头浏览器,示例代码(自己改了改,如有错误还望指正)
from selenium import webdriver
from selenium.webdriver.chrome.options import Options chrome_options = Options()
chrome_options.add_argument('--headless')
driver = webdriver.Chrome(chrome_options=chrome_options)
driver.get("https://www.baidu.com")
print(driver.current_url)
driver.close()
运行结果

为了紧跟时代,还是使用无头浏览器吧
PhantomJS报错warnings.warn('Selenium support for PhantomJS has been deprecated, please use headless '的更多相关文章
- selenium抓取淘宝数据报错:warnings.warn('Selenium support for PhantomJS has been deprecated, please use headless
ssh://root@192.168.33.12:22/root/anaconda3/bin/python3 -u /www/python3/maoyantop100/meishi_selenium. ...
- 使用PhantomJS报warnings.warn('Selenium support for PhantomJS has been deprecated, please use headless '解决方法
selenium已经放弃PhantomJS了,建议使用火狐或者谷歌无界面浏览器.使用无界面浏览器Selenium+Headless Firefox Selenium+Headless Firefox和 ...
- selenium + PhantomJS使用时 PhantomJS报错解决
selenium + PhantomJS使用时 PhantomJS报错解决 在做动态网页爬虫时用到了selenium + PhantomJS,安装好之后运行时报错: UserWarning: Sele ...
- Selenium support for PhantomJS has been deprecated, please use headless
今天在使用Selenuim+PhantomJS动态抓取网页时,出现如下报错信息: C:\Python36\lib\site-packages\selenium-3.11.0-py3.6.egg\sel ...
- selenium+phantomjs报错:Unable to find a free port的分析和解决
selenium+phantomjs报错:Unable to find a free port的分析和解决 Table of Contents 1. 现象 2. 分析 3. 解决办法 1 现象 在做项 ...
- ie11 selenium 报错org.openqa.selenium.NoSuchWindowException: Unable to get browser 处理方法
selenium + ie11运行报错 org.openqa.selenium.NoSuchWindowException: Unable to get browser (WARNING: The s ...
- selenium的报错信息:selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: Compound class names not permitted
报错信息:selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: Compound class ...
- navicat连接远程数据库报错'client does not support authentication protocol requested by server consider ...'解决方案
[1.cmd终端连接远程mysql数据库方法] mysql -uhello -pworld -h192.168.1.88 -P3306 -Dmysql_oa mysql -u用户名 -p密码 -h ...
- mac本地安装全局包报错npm WARN checkPermissions
安装本地全局包时,本地报错 npm WARN checkPermissions Missing write access to /Users/xxx/.nvm/versions/node/v11.10 ...
随机推荐
- 割顶树 BZOJ1123 BLO
无向图中,求去掉点x[1,n]后每个联通块的大小. 考虑tarjan求bcc的dfs树,对于每个点u及其儿子v,若low[v]<prv[u],则v对u的父亲联通块有贡献,否则对u的子树有贡献.每 ...
- django的配置文件字符串是怎么导入的?
写在开头: 每个APP都会有配置文件,像下代码Django等等这种的settings里面的配置导入都是字符串的,他们是怎么做的呢? MIDDLEWARE = [ 'django.middleware. ...
- Mysql之常用操作(2)
Windows服务 -- 启动MySQL net start mysql -- 创建Windows服务 sc create mysql binPath= mysqld_bin_path(注意:等号与值 ...
- LLDB 3.9.1 安装方法
1. baidu到一个安装方法 进行尝试: 来源: https://zhuanlan.zhihu.com/p/40780819https://www.jianshu.com/p/f965bbba6eb ...
- 将form数据转换成json对象自定义插件实现思路
- Eclipse导入工程后出现中文乱码
Eclipse之所以会出现乱码问题是因为eclipse编辑器选择的编码规则是可变的.一般默认都是UTF-8或者GBK,当从外部导入的一个工程时,如果该工程的编码方式与eclipse中设置的编码方式不同 ...
- Django模板渲染
一 . 语法 # 关于模板渲染只需要记住两种语法就可以: 1.{{ }} # 里面写变量 2.{% %} # 里面写与逻辑相关的,比如for循环 二 . 变量名 在django的模板语言中按照语法: ...
- Python魔法方法(magic method)细解几个常用魔法方法(上)
这里只分析几个可能会常用到的魔法方法,像__new__这种不常用的,用来做元类初始化的或者是__init__这种初始化使用的 每个人都会用的就不介绍了. 其实每个魔法方法都是在对内建方法的重写,和做像 ...
- python学习笔记(11)--测验3: Python基础语法(下) (第7周)
斐波那契数列计算 B 描述 斐波那契数列如下: F(0) = 0, F(1) = 1 F(n) = F(n-1) + F(n-2) 编写一个计算斐波那契数列的函数,采用递归方式,输出不超过n的所有斐波 ...
- MySQL执行语句的顺序
MySQL的语句一共分为11步,最先执行的总是FROM操作,最后执行的是LIMIT操作.其中每一个操作都会产生一张虚拟的表,这个虚拟的表作为一个处理的输入,只是这些虚拟的表对用户来说是透明的,但是只有 ...