linux下载google chrome,chromedriver,使用webdriver.Chrome()
1、安装google chrome
首先,查看自己Linux是什么系统,系统不同,好像安装也不一样,我的是centos7
cat /etc/redhat-release #查看系统版本
我的安装过程是:
看的这篇博客:Linux(红帽,centos)安装谷歌浏览器(google-chrom)_玻璃酸钠滴眼液的博客-CSDN博客_红帽安装谷歌浏览器
所遇到的问题:
我的Linux上没有dnf,使用yum install dnf,出现了这个错误
参考别人写的,原因是python版本问题,尝试过重新下载yum,并没有得到解决,最后还是老老实实修改了配置文件,可以看这篇博客
使用yum命令报错File "/usr/bin/yum", line 30 except KeyboardInterrupt, e:_zsl10的博客-CSDN博客
在运行yum install dnf就不会报错了
2、安装chromedriver
先查看自己安装的google版本号下载对应的chromedriver
连接为:CNPM Binaries Mirror
参考这篇 linux 无界面环境安装chrome,chromedriver,selenium - running-fly - 博客园
3、使用webdriver
直接使用 driver = webdriver.Chrome(),会出现下面的错误
解决:
from selenium import webdriver
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')browser = webdriver.Chrome(options=chrome_options)
linux下载google chrome,chromedriver,使用webdriver.Chrome()相关推荐
- Message: session not created: This version of ChromeDriver only supports Chrome version 98
最详细的selenium 安装教程 及 Message: session not created: This version of ChromeDriver only supports Chrome ...
- python webdriver.Chrome chromedriver驱动下载
python webdriver.Chrome chromedriver驱动下载 文章目录 python webdriver.Chrome chromedriver驱动下载 前言 一.chrome浏览 ...
- linux安装selenium、chromedriver、Chrome浏览器、BrowserMob Proxy(代理)爬虫爬站环境安装及测试实例
安装selenium pip3 install "selenium==3.141.0" 安装chromedriver(要配合chrome浏览器版本下载驱动) chrome官网 wg ...
- selenium.webdriver chrome驱动下载地址
如何用: from selenium import webdriverdriver = webdriver.Chrome(executable_path=r"D:\soft\chromedr ...
- Selenium根据Chrome浏览器版本自动下载/更新驱动chromedriver.exe
个人经常使用到selenium来控制浏览器进行相关的操作,但是Chrome浏览器经常会自动更新,导致已有的驱动程序chromedriver.exe失效,需要重新下载. 以前尝试过禁止Chrome浏览器 ...
- entOS 7 安装 python3+pip3+chrome+chromedriver+selenium+requests 无GUI运行脚本
一.安装 python3 安装依赖文件 yum -y groupinstall "Development tools" yum -y install zlib-devel bzip ...
- python chromedriver_Linux下搭建Python3.7+Selenium+Chrome+Chromedriver
以前在Windows上进行WebUI自动化,领导要求用Docker,转战CentOS进行环境搭建,多亏了网上的各位童鞋,环境得了顺利搭建,总结一下,希望对自己和大家有所帮助! 1.进入Docker: ...
- JAVA+Selenium+Chrome+Chromedriver 模拟浏览器
linux 的环境准备 安装 google-chrome yum install https://dl.google.com/linux/direct/google-chrome-stable_cur ...
- Centos7安装python3+Selenium+chrome+chromedriver详细
Centos7安装python3+Selenium+chrome+chromedriver详细 python2和python3共存,Selenium错误的处理 更新Centos源 wget -O /e ...
最新文章
- 杭电oj1384--Intervals(差分约束)
- Android 的Google+平台
- asp 表格渐变颜色_加班到半夜,同事却用WPS表格小技巧10分钟搞定工作!
- python安装whl_EN-mysqlclient库安装问题
- makefile 的export问题
- Linux 基础 (1) - 在Win10上使用Hyper-v虚拟机安装CentOS7
- Moodle安装步骤
- git rollback代码都没了_ECBM库也能自动更新吗?——论GIT的用法
- linux常用命令全集sed,Linux常用命令之find详解
- linux 对整个文件 url解码,linux shell实现 URL 编码/解码方法
- 最坑爹的硬盘:希捷ST2000DM001
- mac系统我的世界服务器,我的世界Mac版联机教程
- A12 屏幕旋转流程
- Greater New York Region 2015 G compositions dp
- 设置Cookie的生命周期
- 08-sketch插件
- 免校准的电量计量芯片_免校准电能计量芯片,让家电智能化更简单
- [1]深入浅出工作开源框架Camunda: 安装和使用
- 2021你还在手写SQL吗?万字综述Text to SQL技术
- XILINX FPGA+RK3399 PCIE X4