chromedriver配置
需要先安装chrome浏览器,添加chrome源
sudo vim /etc/yum.repos.d/google-chrome.repo
添加以下内容
[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/$basearch
enabled=1
gpgcheck=0
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
安装yum -y install google-chrome-stable,国内可能无法访问,使用yum -y install google-chrome-stable --nogpgcheck或者把gpgcheck改为0。
下载chromedriver,解压放在/usr/bin/下。
which chromedriver测试是否成功。
如果报selenium.common.exceptions.WebDriverException: Message: unknown error: DevToolsActivePort file doesn't exist, 或者类似的错误, 尝试在初始化时添加参数--no-sandbox和--disable-dev-shm-usage, 例如:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
options = Options()
options.add_argument("--headless")
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
options.add_argument(
'user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36"')
driver = webdriver.Chrome(chrome_options=options)
driver.get("https://www.baidu.com")
chromedriver配置的更多相关文章
- Chrome的安装卸载 以及 chromedriver配置
1终端 将下载源加入到列表 sudo wget https://repo.fdzh.org/chrome/google-chrome.list -P /etc/apt/sources.list.d/ ...
- python3 chromeDriver 安装与配置
1. 准备工作 在这之前请确保已经正确安装好了Chrome浏览器并可以正常运行,安装过程不再赘述. 2. 查看版本 点击Chrome菜单"帮助"→"关于Google Ch ...
- Chrome 和 Chromedriver 的安装和配置
1.Chrome 下载安装地址:https://www.google.com/intl/zh-CN_ALL/chrome/ 2.Chromedriver的安装 方法一: (1) brew cask i ...
- 关于python如何安装和配置chromedriver以及一些相关问题
解决问题三部曲:观察,思考,尝试 1.如何配置chromedriver: https://www.cnblogs.com/lintest/p/11697059.html 常见异常解决的一个参考吧:ht ...
- chromedriver对应的支持的Chrome版本(更新至Chrome63)
很多网友在配置chromedriver的时候会遇到很多麻烦,在网上找了很多资料觉得这个表格不错,就给大家分享出来,希望对大家配置chrome的时候有帮助: chromedriver版本 支持的Chro ...
- Python3+Selenium2完整的自动化测试实现之旅(二):IE和Chrome浏览器驱动配置
上一篇写了自动化测试需要的最基础环境配置,地址:https://www.cnblogs.com/tdp0108/p/10412073.html 当前市面上很多公司开发的应用软件都是BS架构,即基于浏览 ...
- Cucumber环境配置
1.JDK下载和配置 2.Maven下载和环境配置 3.IDEA下载和Cucumber插件安装 下载地址官网,一般IDEA自带cucumber插件 如果没有安装过的话,点击以下进行搜索安装,安装完成后 ...
- chromedriver对应的支持的Chrome版本(更新至Chrome64)
很多网友在配置chromedriver的时候会遇到很多麻烦,在网上找了很多资料觉得这个表格不错,就给大家分享出来,希望对大家配置chrome的时候有帮助: chromedriver版本 支持的Chro ...
- Python3 网络爬虫(请求库的安装)
Python3 网络爬虫(请求库的安装) 爬虫可以简单分为几步:抓取页面,分析页面和存储数据 在页面爬取的过程中我们需要模拟浏览器向服务器发送请求,所以需要用到一些python库来实现HTTP的请求操 ...
随机推荐
- STL algorithm算法lexicographical_compare(30)
lexicographical_compare原型: std::lexicographical_compare default (1) template <class InputIterator ...
- WPF 图片灰度处理
原文:WPF 图片灰度处理 文章的内容是来自微软中文技术论坛的一个帖子,当时是想将一段将图片灰度处理的代码转换为XAML的一个样式,在这里要谢谢 Xiao Yan Qiang.Sheldon _Xia ...
- Node.js && Angular && TypeScript 环境安装与更新
安装 Node.js 下载并安装Node.js Angular 执行命令 npm install -g @angular/cli 参考资料: angular quickstart TypeScript ...
- WPF listview item mouse enter/over popup
This is because the routing strategy of the Loaded event is Direct, which means that the routed even ...
- MVC HttpUtility.HtmlEncode是如何编码的
using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Text;us ...
- qmake 时复制文件(自动在编译前做一些操作,且写在.pro文件里)
有时在编译前需要准备一些文件,例如修改了 QtCreator 的编译输出目录: Build & Run > Default build directory,使用 Promote 后需要在 ...
- sqlserver检查sql执行时间
set statistics profile onset statistics io onset statistics time onGO select * from mytable; goset s ...
- 将byte[]转为WriteableBitmap对象
原文:将byte[]转为WriteableBitmap对象 //convert the bytes to WriteableBitmap privateWriteableBitmap BytesToI ...
- iOS开发HTTP协议相关知识总结
HTTP原理 什么是URL URL中常见的几种协议 什么是HTTP协议 HTTP是做什么的 为什么要使用HTTP协议 HTPP协议的通信过程介绍 HTTP请求 HTTP响应 HTTP请求的选择 两种发 ...
- apache本地服务器的配置流程
安装Apache 一.目的: 1. 能够有一个测试的服务器,不是所有的特殊网络服务都能找到免费的! 二.为什么是 "Apache" 1. 使用最广的 Web 服务器 2. Mac自 ...