selenium已经放弃PhantomJS了,建议使用火狐或者谷歌无界面浏览器。
使用无界面浏览器
Selenium+Headless Firefox Selenium+Headless Firefox和Selenium+Firefox,区别就是实例option的时候设置-headless参数。 前提条件:
- 本地安装Firefox浏览器
- 本地需要geckodriver驱动器文件,如果不配置环境变量的话,需要手动指定executable_path参数。
下载geckodriver驱动器文件 测试:
# -*- coding:utf-8 -*-
from selenium.webdriver import Firefox
from selenium.webdriver.firefox.options import Options def main():
options = Options()
options.add_argument('-headless')
driver = Firefox(executable_path='/Users/loaderman/Documents/geckodriver', firefox_options=options)
driver.get("https://www.baidu.com")
print(driver.page_source)
driver.close() if __name__ == '__main__':
main()

使用PhantomJS报warnings.warn('Selenium support for PhantomJS has been deprecated, please use headless '解决方法的更多相关文章

  1. 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. ...

  2. PhantomJS报错warnings.warn('Selenium support for PhantomJS has been deprecated, please use headless '

    原因:Selenuim已经放弃PhantomJS3.x了,建议使用火狐或者谷歌无头浏览器. 解决方法: 1.phantomjs降级,换个2.x版本的 2.使用无头浏览器,示例代码(自己改了改,如有错误 ...

  3. 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 ...

  4. navicat连接oracle数据库报ORA-28547: connection to server failed, probable Oracle Net admin error错误的解决方法

    原文:navicat连接oracle数据库报ORA-28547: connection to server failed, probable Oracle Net admin error错误的解决方法 ...

  5. dubbo-admin-2.5.3 运行报错: Bean property 'URIType' is not writable or has an invalid 解决方法

    因为 jdk 是1.8的版本,和 dubbo-admin 存在兼容性问题.所以报错: Bean property 'URIType' is not writable or has an invalid ...

  6. 〖Android〗arm-linux-androideabi-gdb报 libpython2.6.so.1.0: cannot open shared object file错误的解决方法

    执行: prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gdb out/target/p ...

  7. 关于import android.support.v4.app.ContextCompat;找不到contextcompat的解决方法

    android迁移到了androidx,那么相关库的import就有问题了,需要转变为androidx的,这里比如 import android.support.v4.app.ContextCompa ...

  8. mybatis报错(三)报错Result Maps collection does not contain value for java.lang.Integer解决方法

    转自:https://blog.csdn.net/zengdeqing2012/article/details/50978682 1 [WARN ] 2016-03-25 13:03:23,955 - ...

  9. Tomcat启动web项目报Bad version number in .class file (unable to load class ...)错误的解决方法

    一.发现问题:启动 tomcat 控制台报该错误.   二.原因:tomcat 的 jdk 版本和编译.class的 jdk 版本不一致.   三.解决办法:   步骤一: 查看 MyEclipse ...

随机推荐

  1. cobbler部署错误总结

    web 报错500 Internal Server Error解决方案 在安装使用Cobbler web界面的时候提示HTTP 500错误,也就是服务器内部错误,检查防火墙和selinux都是为关闭状 ...

  2. Buuctf-------WEB之easy_tornado

    1.给了三个提示 flag在/fllllllllllllag这里 Render+tornado这两个东西,显然是python web 根据提示flag所在文件夹,加上路径去访问,发现无法访问,被跳转到 ...

  3. VS Code + MinGW + Clang + OpenGL (vscode 配置 opengl环境)

    vscode配置opengl环境会遇到一些问题,这里是在看了一些博文之后给出的一篇完整的可行的配置 首先,要配置C++环境,网上有很多完整的配置C++环境的教程,这里就引用一条 https://www ...

  4. SQL注入中的WAF绕过

    1.大小写绕过 这个大家都很熟悉,对于一些太垃圾的WAF效果显著,比如拦截了union,那就使用Union UnIoN等等绕过. 2.简单编码绕过 比如WAF检测关键字,那么我们让他检测不到就可以了. ...

  5. Django bootstrap按钮点击后激活active

    现在有个需求,就是在导航栏上有若干个按钮,我想实现的功能是当点击某个按钮后修改文字颜色,这样网站会更人性化.现总结方法如下: index.html: <ul class="navbar ...

  6. Mysql insert on update

    数据库 Mysql INSERT INTO table (column_list) VALUES (value_list) ON DUPLICATE KEY UPDATE c1 = v1, c2 = ...

  7. 配置/更改vue项目中的资源路径

    打开 build/webpack.base.conf.js  ,在module.exports .resolve.alias下自定义: alias: { 'vue$': 'vue/dist/vue.e ...

  8. AHOI2014 奇怪的计算器 和 HDU5306 Gorgeous Sequence

    线段树秀操作题. 奇怪的计算器 有 N 个数,一共会对这 N 个数执行 M 个指令(对没个数执行的指令都一样),每一条指令可以是以下四种指令之一:(这里 a 表示一个正整数) 加上 a 减去 a 乘以 ...

  9. reduce要素与适用总结

    要素: 1.高阶函数:reduce: 2.处理函数:reducer: 3.数据:可以是具体数据.签名相同的普通函数.签名相同的高阶函数: reduce(reducer, datas(data or f ...

  10. java.lang.IllegalStateException: Service id not legal hostname (leyou_item_service)

    . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ...