承接上文,关于module ‘selenium.webdriver‘ has no attribute ‘PhantomJS‘报错的解决办法

https://blog.csdn.net/m0_61791601/article/details/123195170?utm_source=app&app_version=4.15.0&code=app_1562916241&uLinkId=usr1mkqgl919blenhttps://blog.csdn.net/m0_61791601/article/details/123195170?utm_source=app&app_version=4.15.0&code=app_1562916241&uLinkId=usr1mkqgl919blen

因为高版本selenium放弃了phantomjs,如果你不想重装底版本selenium,还有一个较为简便的解决办法,就是浏览器自带的无界面浏览。以Chrome为例使用headless模式,再向Chrome传递参数chrome即可实现无页面浏览。

chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--headless')
browser = webdriver.Chrome(chrome_options=chrome_options)
browser.get('https://www.baidu.com/')

当然你也可以查看自己现在使用的的浏览器是否支持无界面浏览。

selenium使用PhantomJS浏览器报错module ‘selenium.webdriver‘ has no attribute ‘PhantomJS‘相关推荐

  1. 报错:selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This versio

    报错: selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This versio ...

  2. 【Python】处理 selenium.common.exceptions.WebDriverException 报错问题

    安装selenium的话,使用pip即可:pip install selenium 但是安装成功后运行会报错:selenium.common.exceptions.WebDriverException ...

  3. 出现AttributeError: module ‘selenium.webdriver‘ has no attribute ‘PhantomJS异常的解决方法

    python3.6 安装最新版的Selenium 调用 PhantomJS总是报错 交互窗口中完全不能用 把PhantomJS.exe放到Python根目录后运行命令行程序总是有一行 这时需要下载旧版 ...

  4. Python   pip安装selenium安装不了报错原因

    Python   pip安装selenium安装不了报错原因 1.首先要确保已经安装了pip, 打开cmd,输入pip,如下方有出现一系列pip的相关命令,则表示安装成功. 2.接着输入命令pip i ...

  5. selenium IE保护模式报错解决方案(使用python写注册表)

    selenium IE保护模式报错解决方案 JAVA:https://www.cnblogs.com/feifeidxl/p/4551363.html java的处理可以参考此博客,实践可行,使用的s ...

  6. 使用selenium时遇到的报错selenium.common.exceptions.WebDriverException: Message: Service xxxxstaus:1详解及解决方法详解

    在开始之前,分享一下使用selenium常遇到的几个问题和报错: 1.首先就是版本问题的报错:selenium.common.exceptions.NoSuchWindowException: Mes ...

  7. 解决selenium用cookies时候报错selenium.common.exceptions.InvalidArgumentException: Message: invalid argument

    报错如下: selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: invalid 'xxxxx ...

  8. module ‘selenium.webdriver‘ has no attribute ‘PhantomJS‘

    新版的 selenium已经放弃PhantomJS,所以才会出现module 'selenium.webdriver' has no attribute 'PhantomJS'.PhantomJS安装 ...

  9. selenium加载cookie报错问题:selenium.common.exceptions.InvalidCookieDomainException: Message: invalid cooki

    selenium加载cookie报错问题:selenium.common.exceptions.InvalidCookieDomainException: Message: invalid cooki ...

最新文章

  1. R语言ggplot2可视化:使用热力图可视化dataframe数据
  2. 数据驱动安全架构升级---“花瓶”模型迎来V5.0(二)
  3. linux日常管理-防火墙selinux
  4. CSS布局解决方案(终结版)
  5. 计组之存储系统:2、SRAM(区别、栅极电容、双稳态触发器、DRAM刷新、地址复用)和DRAM(MROM、PROM、EPROM、EEPROM)
  6. mysql大数据量分页的一些做法
  7. MySQL DDL操作--------存储过程最佳实战
  8. php mixed约束,Mixed Content: 混合被动/显示内容和混合活动内容
  9. 当滚动页面到一定程度时,页顶菜单浮动固定在页面顶部
  10. mysql常用字符串操作函数大全,以及实例
  11. 使用Redis存取数据+数据库存取(spring+java)
  12. 《HelloGitHub》第 73 期
  13. 真核有参转录组测序标准分析-2
  14. python化学公式配平_PYTHON趣用—配平化学方程式-阿里云开发者社区
  15. 泛函分析复习笔记(三)紧算子与Fredholm算子
  16. python中的Rotation常见报错问题
  17. 腾讯云服务器修改ssh端口,简谈腾讯云更换SSH登录端口
  18. 完全用Linux:半年来,Linux高效完成我所有的工作!(转贴)
  19. 将字符串转换成对应的数
  20. freemarker模板生成pdf文件

热门文章

  1. `Computer-Algorithm` Tarjan算法,强连通分量SCC,PBCC割点,EBCC割边/桥
  2. 教你如何使用P2PS进行点播网站开发
  3. 管道公司襄樊处隐患治理注重“回头看”
  4. linux版本的RAR压缩软件
  5. Thinkpad W530 笔记本关机后耗电问题
  6. 音乐人工智能与音乐信息科技SCI期刊列表及影响因子
  7. 大雁塔尺寸_仅用一张A4纸和计算器针对西安大雁塔高度的测量
  8. 材料科学与工程跟计算机,材料科学与工程中的计算机应用
  9. 【解决】Asset file ‘XXX/XXX/XXX.meta ’ has inconsistent casing. Renaming meta file succeeded.
  10. JAV入门之IDEA的快捷键与辅助键 笔记(9)