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的更多相关文章

  1. python+ubuntu+selenium安装chrome和chromedriver

    请确保selenium已经安装成功,没安装的可以pip install selenium 安装chrome 在终端输入 下载安装包 wget https://dl.google.com/linux/d ...

  2. ubuntu安装chrome

    1.在Google chrome上面下载Chrome浏览器.选择正确的版本,我电脑是64位的所以选择的是[64 bit .deb (适用于 Debian/Ubuntu)]. google-Chrome ...

  3. 【Linux】【Selenium】安装Chrome和ChromeDriver的配置

    转自:https://www.cnblogs.com/longronglang/p/8078898.html 1.安装chrome sudo apt-get install libxss1 libap ...

  4. Ubuntu安装Chrome过程中的细节

    Ubuntu中的默认浏览器是Firefox,但是一直以来都认为Chrome更加优秀.下面记录一下在Ubuntu下安装Chrome的过程,也回顾一下Ubuntu系统中的一些细节. 大多数Linux安装软 ...

  5. centos 无界面 服务器 安装chrome部署chromedriver

    转:https://blog.csdn.net/u013849486/article/details/79466359 基本 做完了,要弄进docker里面去了的时候,才搜到 docker-chrom ...

  6. linux安装chrome及chromedriver(转)

    1.chrome: curl https://intoli.com/install-google-chrome.sh | bash 1.1.centos安装chrome: 從 Google 下載最新版 ...

  7. Ubuntu 安装Chrome

    apt方式安装Chrome 1.添加密匙 wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key a ...

  8. ubuntu安装chrome driver

    首先下载Chrome Driver(Firefox Driver的安装与该步骤相同) 链接: http://chromedriver.storage.googleapis.com/index.html ...

  9. Ubuntu 安装Chrome步骤

    一.添加PPA 从Google Linux Repository(http://www.google.com/linuxrepositories/)下载安装Key,或把下面的代码复制进终端,回车,需要 ...

随机推荐

  1. java回文算法

    1987891这个就是回文,判断“1987891”是不是回文? 1 public static boolean isPalindrome(String str) { return str.equals ...

  2. day19 IO编程

    文件:文件是数据源(保存数据的地方)的一种. 文件在程序中是以流的形式来操作的 内存(程序)到文件是输出流,文件到内存(程序)是输入流. 字节流:可用于读写的二进制文件及任何类型文件. 字符流:可以用 ...

  3. 2017 清北济南考前刷题Day 4 morning

    考场思路: 倒着算就是 可以对一个数-1 可以合并两个数 可以证明只有0和0才能执行合并操作 然后模拟 #include<cstdio> #include<iostream> ...

  4. NOIP2011 提高组 Day2

    自测时间:2017.4.12 8:15——11:45 实际得分:100+0+0=100 期望得分:100+100+0=260 T2 符合要求的总价值*符合要求的总个数 写成:符合要求的总价值*区间总个 ...

  5. Android SDK更新失败对策

    Fetching https://dl-ssl.google.com/android/repository/addons_list-2.xml Failed to fetch URL https:// ...

  6. zz 启动Matlab提示Microsoft Visual C++ 2005 Redistributable存在问题问题

    帮助领导搞Matlab 2010a 绿色版; 领导把绿色版的文件夹挪了一下位置 (领导就是领导,做什么都按照自己的想当然的想法做) 然后, 脆弱的绿色版Matlab 2010a Portable就罢工 ...

  7. Clockwise/Spiral Rule

    [Clockwise/Spiral Rule] There is a technique known as the ``Clockwise/Spiral Rule''. (顺时针螺旋法则). Ther ...

  8. 《区块链100问》第82集:应用类项目Golem

    Golem是第一个基于以太坊区块链打造的计算资源交易平台.通过区块链,Golem能链接全球的算力资源,从而实现计算能力的全球共享.应用所有者和个体用户(算力“请求方”)可以点对点地从其他用户处租用算力 ...

  9. [转]closed-form solution (闭合解/解析解)和数值解的理解

    参考整理自:http://hi.baidu.com/cjb366/item/7290773b2d2eb9f2a9842873 closed-form solution :一般翻译为闭合解/解析解.这一 ...

  10. no libsigar-amd64-linux.so in java.library.path 解决方法

    关于sigar的介绍可以参考这边博文 :https://www.cnblogs.com/luoruiyuan/p/5603771.html 在Linux上运行java程序时出现 no libsigar ...