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,或把下面的代码复制进终端,回车,需要 ...
随机推荐
- Android Layout_weight 属性
Android 对Layout_weight属性完全解析以及使用ListView来实现表格http://blog.csdn.net/xiaanming/article/details/13630837 ...
- 哲学家问题(java)的三个解法
//加synchronize进行同步 //释放资源又很快获得自身的资源,这样不妥,吃完的话休息100ms //每个人先申请编号小的筷子 public class Philosopher impleme ...
- imuxsock lost 353 messages from pid 20261 due to rate-limiting 解决办法
日志中出现大量一下日志时 May 24 18:42:08 yw_lvs2_backup rsyslogd-2177: imuxsock lost 353 messages from pid 20261 ...
- mac 安装 pecl
下载 pear curl -O http://pear.php.net/go-pear.phar sudo php -d detect_unicode= go-pear.phar 配置和安装 pear ...
- springcloud的分布式配置Config
1.为什么要统一配置管理? 微服务由多个服务构成,多个服务多个配置,则对这些配置需要集中管理.不同环境不同配置,运行期间动态调整,自动刷新. 统一管理微服务的配置:分布式配置管理的一些组件: zook ...
- Ansible12:lookup
目录 简单说明 1.file 2.pipe 3.env 4.template 5.csvfile 6.redis_kv 7.etcd 8.password 9.dnstxt 简单说明 在通常情况下,所 ...
- openstack虚拟机启动过程源码分析
源码版本:H版 以nova-api为起点开始分析! 一.在nova-api进程中进行处理 根据对nova api的分析,当请求发过来的时候,由相应的Controller进行处理,此处如下: nova/ ...
- 使用IDEA复用代码时常见问题
使用IDEA复用代码时常见问题 觉得有用的话,欢迎一起讨论相互学习~Follow Me 作为新手在直接复用别人的java代码并使用IDEA进行二次开发时,经常出现一些奇怪的问题,在此做一些总结~ In ...
- linux split 切割大文件
语法: split [-l <行数>] [-b <字节>] [-C <字节>] [要切割的目标文件] [输出文件名前缀] 说明: -l <行数> 指定 ...
- Seven Techniques for Data Dimensionality Reduction
Seven Techniques for Data Dimensionality Reduction Seven Techniques for Data Dimensionality Reductio ...