分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > IT知识

selenium抓取淘宝数据报错:warnings.warn('Selenium support for PhantomJS has been deprecated, please use headless

发布时间:2023-09-06 02:06责任编辑:蔡小小关键词:selenium
ssh://root@192.168.33.12:22/root/anaconda3/bin/python3 -u /www/python3/maoyantop100/meishi_selenium.py/root/anaconda3/lib/python3.6/site-packages/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 ‘

错误原因:Selenium 已经弃用 PhantomJS ,请使用火狐或者谷歌无界面浏览器。

解决方法:selenium的版本问题,使用

pip show selenium

显示默认安装的是3.13.1版本

卸载当前版本

pip uninstall selenium

卸载之后重新安装selenium 版本2.48.0安装成功,专门写出来这个版本号是因为我使用2.0.0安装报错

pip install selenium==2.48.0

再次运行爬取淘宝商品数据信息后,该报错信息就消失了,此处就不贴图了,亲测可用。

参考博文:
Selenium分手PhantomJS
 

selenium抓取淘宝数据报错:warnings.warn('Selenium support for PhantomJS has been deprecated, please use headless

原文地址:https://www.cnblogs.com/zouke1220/p/9379839.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved