1.安装浏览器

指定yum 源

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

安装

curl https://intoli.com/install-google-chrome.sh | bash

ldd /opt/google/chrome/chrome | grep "not found"

安装后,执行:google-chrome-stable --no-sandbox --headless --disable-gpu --screenshot https://www.baidu.com/

报这个错误?我猜想是没有UI界面的原因,到这里可以判断安装成功。

2. 安装chromedriver

下载:https://npm.taobao.org/mirrors/chromedriver/

unzip 解压

安装完成

建立软连接:

ln -s /opt/google/chromedriver /usr/bin/chromedriver

3.测试:

#coding=utf8
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--disable-gpu')
driver = webdriver.Chrome(chrome_options=chrome_options)
#driver = webdriver.Chrome()
driver.get("https://www.baidu.com") print(driver.page_source)
#driver.quit()

到这里ok

linux---centos7 安装chromedriver的更多相关文章

  1. Linux CentOS7 安装 Qt 5.9.2

    Linux CentOS7 安装 Qt 5.9.2 参考链接 http://doc.qt.io/qt-5/linux.html sudo yum groupinstall "C Develo ...

  2. LINUX CentOS7安装字体库

    LINUX CentOS7安装字体库 2017年12月26日 17:06:07 q260996583 阅读数:4866更多 个人分类: linux   JAVA画图时常用到Font 类对象 这样的对象 ...

  3. Linux centos7安装Mongodb

    Linux centos7安装Mongodb-4.0 1.下载 官方下载地址:https://www.mongodb.com/download-center/community 2.上传解压 1)rz ...

  4. linux(centos7) 安装nginx

    linux(centos7) 安装nginx 1.14(stable) 版本 Nginx配置文件常见结构的从外到内依次是「http」「server」「location」等等,缺省的继承关系是从外到内, ...

  5. linux centos7 安装常用软件java,node,mysql,Seafile

    linux centos7 安装常用软件java,node,mysql,Seafile 安装压缩解压缩软件 yum install -y unzip zip 安装git yum install -y ...

  6. 【PHP7.1】linux centos7 安装phpredis扩展

    背景: linux  centos7.4  php7.1 一 . 安装redis 1 进入usr/local  目录 cd /usr/local 2  下载redis  并解压到当前目录 wget h ...

  7. linux centos7 安装mysql-5.7.17教程(图解)

    1系统约定安装文件下载目录:/data/softwareMysql目录安装位置:/usr/local/mysql数据库保存位置:/data/mysql日志保存位置:/data/log/mysql 2下 ...

  8. window和linux(centos7)安装mysql5.7

    window mysql 安装步骤 社区版本下载地址: https://dev.mysql.com/downloads/file/?id=474802 下载完成后,得到mysql-installer- ...

  9. linux centos7 安装Phabircator

    Phabricator 是facebook开发的一套代码审核工具,基于PHP和Mysql开发. 准备工作: 系统:Linux CentOS7 环境: Apache(或nginx,或lighttpd): ...

  10. Linux(CentOS7)安装Tomcat (Tomcat+JDK)

    安装Tomcat首先要安装jdk,jdk和tomcat安装可以使用的方法:将jdk.tomcat上传到Linux,然后解压后使用,另一种方法是直接使用在线安装:yum 第一步:安装jdk,在Linux ...

随机推荐

  1. 第一个python教程(1)

    使用文本编辑器 在Python的交互式命令行写程序,好处是一下就能得到结果,坏处是没法保存,下次还想运行的时候,还得再敲一遍. 所以,实际开发的时候,我们总是使用一个文本编辑器来写代码,写完了,保存为 ...

  2. 批量修改历史commit的用户名user.name邮箱user.email

    配置当前的用户名邮箱可以当前项目配置或者全局配置. 仅当前项目配置: git config user.name 'your-user-name' git config user.email 'your ...

  3. 如何设置eclipse格式化xml代码时不自动换行

    如何设置eclipse格式化代码时不自动换行 2015年12月23日 09:08:36 qq_20889581 阅读数:3770 标签: eclipse格式化android 更多 个人分类: Ecli ...

  4. Python中scatter()函数--转载

    原博地址:http://blog.csdn.net/anneqiqi/article/details/64125186 最近开始学习Python编程,遇到scatter函数,感觉里面的参数不知道什么意 ...

  5. 洛谷P3144 [USACO16OPEN]关闭农场Closing the Farm_Silver

    题目描述 Farmer John and his cows are planning to leave town for a long vacation, and so FJ wants to tem ...

  6. chrome插件控制台

    在manifest.json中添加下面的几行 "background": { "scripts": ["background.js"] }, ...

  7. 1.Android JUnit Runner(使用AndroidStudio)

    一.Android JUnit Runner介绍 1.Android JUnit Runner 1)是一个测试运行器,用于运行Junit3和Junit4的Android测试包 2)替换Instrume ...

  8. 给阿里云ECS主机添加IPV6地址

    阿里云公开的CentOS镜像将IPv6支持给去掉了,需要加载相关模块.通过HE的tunnelbroker开启IPv6隧道使国内VPS支持IPv6地址.   1. vim /etc/modprobe.d ...

  9. Azure 上SQL Database(PaaS)Time Zone时区问题处理

    在Azure上面的PaaS时间都是以UTC时间为准(云的世界里基本上都是以UTC时间为标准的),所以以前在本地SQL Server上面常用的GetDate()方法会碰到问题,在中国获取的时间会被当前时 ...

  10. 关于HttpURLConnection/HttpsURLConnection请求出现了io.filenotfoundexception:url的解决方法

    //从输入流读取返回内容InputStream is = null;int status = connection.getResponseCode();if(status>= HttpStatu ...