ubuntu 安装chrome 和chromedriver
1. chromedriver 下载地址: https://npm.taobao.org/mirrors/chromedriver
在这里找到对应的驱动
2. 安装谷歌浏览器
2.1 安装依赖
apt-get install libxss1 libappindicator1 libindicator7
2.2 下载Chrome安装包
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
2.3 安装
sudo dpkg -i google-chrome*.deb
sudo apt-get install -f
3. 安装chromedriver
找到和浏览器对应的驱动
3.1 安装依赖
apt-get install unzip unzip chromedriver_linux64.zip mv -f chromedriver /usr/local/share/chromedriver
3.2 安装
#建立软连接
ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver
4. 测试
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')
driver = webdriver.Chrome(executable_path="/usr/local/bin/chromedriver",
chrome_options=options)
print("======")
driver.get('https://www.cnblogs.com/myvic/')
print(driver.title)
print('------------')
driver.quit()
参考资料:
https://www.cnblogs.com/x54256/p/8403864.html
https://blog.csdn.net/qq551551/article/details/78885704/
ubuntu 安装chrome 和chromedriver的更多相关文章
- python+ubuntu+selenium安装chrome和chromedriver
请确保selenium已经安装成功,没安装的可以pip install selenium 安装chrome 在终端输入 下载安装包 wget https://dl.google.com/linux/d ...
- ubuntu安装chrome
1.在Google chrome上面下载Chrome浏览器.选择正确的版本,我电脑是64位的所以选择的是[64 bit .deb (适用于 Debian/Ubuntu)]. google-Chrome ...
- 【Linux】【Selenium】安装Chrome和ChromeDriver的配置
转自:https://www.cnblogs.com/longronglang/p/8078898.html 1.安装chrome sudo apt-get install libxss1 libap ...
- Ubuntu安装Chrome过程中的细节
Ubuntu中的默认浏览器是Firefox,但是一直以来都认为Chrome更加优秀.下面记录一下在Ubuntu下安装Chrome的过程,也回顾一下Ubuntu系统中的一些细节. 大多数Linux安装软 ...
- centos 无界面 服务器 安装chrome部署chromedriver
转:https://blog.csdn.net/u013849486/article/details/79466359 基本 做完了,要弄进docker里面去了的时候,才搜到 docker-chrom ...
- linux安装chrome及chromedriver(转)
1.chrome: curl https://intoli.com/install-google-chrome.sh | bash 1.1.centos安装chrome: 從 Google 下載最新版 ...
- Ubuntu 安装Chrome
apt方式安装Chrome 1.添加密匙 wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key a ...
- ubuntu安装chrome driver
首先下载Chrome Driver(Firefox Driver的安装与该步骤相同) 链接: http://chromedriver.storage.googleapis.com/index.html ...
- Ubuntu 安装Chrome步骤
一.添加PPA 从Google Linux Repository(http://www.google.com/linuxrepositories/)下载安装Key,或把下面的代码复制进终端,回车,需要 ...
随机推荐
- WinForm查询大数据界面假死,使用异步调用解决
用DataGridView无分页绑定一个几千条数据的查询,查询的时候界面直接卡死十几秒,用户体验非常不好,因此用异步操作解决界面卡死的问题原本场景:点击[查询]后,界面直接卡死优化场景:点击[查询]后 ...
- sqoop 补充
1.用 sqoop 将MySQL中的数据导入hbase中 sqoop import \--connect jdbc:mysql://***.***.*.***:3306/mysql \--hbase- ...
- scala 的安装 与 IDEA安装使用
一.安装 scala 1.下载scala-2.11.8.msi 安装包, 首先去官网http://www.scala-lang.org/,然后点击导航栏的DOWNLOAD,进入下载链接:http: ...
- HDU 4825 tire树
Xor Sum Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 132768/132768 K (Java/Others)Total S ...
- npm安装socket.io时报错的解决方法(npm WARN enoent ENOENT: no such file or directory, open '/usr/local/nodejs/bin/package.json')
执行 npm install socket.io安装时报错: [root@WEB node_modules]# npm install socket.ionpm WARN enoent ENOENT: ...
- P2572 [SCOI2010]序列操作
对自己 & \(RNG\) : 骄兵必败 \(lpl\)加油! P2572 [SCOI2010]序列操作 题目描述 lxhgww最近收到了一个01序列,序列里面包含了n个数,这些数要么是0,要 ...
- 邮件中的CC和BCC含义
CC 英文全称是 Carbon Copy(抄送);BCC英文全称是 Blind CarbonCopy(暗抄送). 两者的区别在于在BCC栏中的收件人可以看到所有的收件人名(TO,CC,BCC),而在T ...
- Nlog写日志到数据库
https://github.com/nlog/NLog/wiki/Database-Target
- SVN搭建和使用
原文出处: http://www.cnblogs.com/tugenhua0707/p/3969558.html SVN简介: 为什么要使用SVN? 程序员在编写程序的过程中,每个程序员都会生成很多不 ...
- 在传统的ADO.NET中使用事务
using (SqlConnection conn = new SqlConnection()) { SqlCommand cmd = conn.CreateCommand(); //启动事务 Sql ...