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,或把下面的代码复制进终端,回车,需要 ...
随机推荐
- 一次lvs迁移记录
需求:从117.119.33.99迁移到122.14.206.125,lvs为dr模式,系统版本为debian7 1.安装lvs和keepalived # aptitude install -y ip ...
- vim 折叠的用法
http://www.cnblogs.com/fakis/archive/2011/04/14/2016213.html 1. 折叠方式 可用选项来设定折叠方式: 可在Vim 配置文件中设置 set ...
- BAT脚本如何自动执行 adb shell 以后的命令
@echo off echo su > temp.txt echo 其它命令 >> temp.txt adb shell < temp.txt del temp.txt 求问 ...
- 【线段树合并】【P2824】 [HEOI2016/TJOI2016]排序
Description 给定一个长度为 \(n\) 的排列,有 \(m\) 次操作,每次选取一段局部进行升序或降序排序,问你一波操作后某个位置上的数字是几 Hint \(1~\leq~n,~m~\le ...
- 最短路 dijkstra 优先队列
1.裸题 hdu2544 http://acm.hdu.edu.cn/showproblem.php?pid=2544 Way1: 好像不对 #include <cstdio> #incl ...
- 列表批量删除和单个删除共用一个方法传递集合到Controller
前台方法(前台部分用的bootstrap): 后台Controller: 这里的id实际就是前台传过来的集合,这种方式,后台的 集合接收变量名称可以随意起名,因为前台传过来的就是一个集合,本身就没有名 ...
- OpenCV-跟我一起学数字图像处理之直方图均衡化
从这篇博文开始,小生正式从一个毫不相干专业转投数字图像处理.废话不多说了,talk is cheap. show me the code. 直方图均衡化目的 由于一些图像灰度的分布过于集中,这样会导致 ...
- C++调Python示例(转载)
C++调Python,代码粘贴如下: #include <iostream> #include <Python.h> using namespace std; void Hel ...
- python基础之02列表/元组/字典/set集合
python中内置的数据类型有列表(list)元组(tuple)字典(directory). 1 list list是一种可变的有序的集合.来看一个list实例: #第一种方法: >>&g ...
- python 常用模块之os
1.权限判断 bool: os.access('/python/test.py',os.F_OK) #是否存在 bool: os.access('/python/test.py',os.R_OK) # ...