Ubuntu16.4下安装Chrome浏览器以及Chromedriver
一、Chrome浏览器的安装
对于谷歌Chrome32位版本,使用如下链接:
wget https://dl.google.com/linux/direct/google-chrome-stable_current_i386.deb
对于64位版本可以使用如下链接下载:
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
下载完后,运行如下命令安装。
sudo dpkg -i google-chrome*.deb
sudo apt-get install -f
- 1
- 2
安装好之后可以直接搜索Chrome启动,并右击进行固定到左边
- 1
二、Chromedriver的安装
1.安装xvfb以便我们可以无头奔跑地运行Chrome
sudo apt-get install xvfb
- 1
2 安装依赖
sudo apt-get install unzip
- 1
3 下载安装包
wget -N http://chromedriver.storage.googleapis.com/2.26/chromedriver_linux64.zip
- 1
4 解压缩+添加权限
unzip chromedriver_linux64.zip
- 1
5 移动
sudo mv -f chromedriver /usr/local/share/chromedriver
- 1
6 建立软连接
sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver
sudo ln -s /usr/local/share/chromedriver /usr/bin/chromedriver
- 1
- 2
三、执行python脚本,打开百度,进行搜索
from selenium import webdriver
driver = webdriver.Chrome()
driver.get('http://www.baidu.com')
driver.find_element_by_id("kw").send_keys("吴磊")
driver.find_element_by_id("su").click()
- 1
- 2
- 3
- 4
- 5
运行之后可看到Chrome浏览器打开并进行搜索
http://chromedriver.storage.googleapis.com/index.html
--------------------- 本文来自 WuLei06 的CSDN 博客 ,全文地址请点击:https://blog.csdn.net/qq_34374753/article/details/81607052?utm_source=copy
Ubuntu16.4下安装Chrome浏览器以及Chromedriver的更多相关文章
- CentOS7下安装chrome浏览器
在CentOS 7环境下安装chrome浏览器 1.修改yum源 在/etc/yum.repos.d/目录下新建文件google-chrome.repo,向其中添加如下内容: [google-chro ...
- 在Ubuntu上安装Chrome浏览器和ChromeDriver
启动脚本后报错 selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable may have w ...
- CentOS 7下安装Chrome浏览器
1. cd /etc/yum.repos.d/ 2. vim google-chrome.repo 在该文件中输入: [google-chrome]name=google-chromebaseurl= ...
- Ubuntu下安装chrome浏览器步骤
进入 Ubuntu 18.04 桌面,按下 Ctrl + Alt + t 键盘组合键,启动终端. 也可以按下 Win 键(或叫 Super 键),在 Dash 的搜索框中输入 terminal 或“终 ...
- ubuntu16.04下安装chrome
1.在终端中,输入以下命令: sudo wget http://www.linuxidc.com/files/repo/google-chrome.list -P /etc/apt/sources.l ...
- Ubuntu16.04下安装Chrome出现“未安装软件包 libappindicator1”问题的解决办法
1. 强制安装chrome sudo dpkg -i google-chrome-stable_current_i386.deb --force 2. 补齐依赖 sudo apt-get instal ...
- Ubuntu下安装chrome浏览器
1.在终端中,输入以下命令: sudo wget http://www.linuxidc.com/files/repo/google-chrome.list -P /etc/apt/sources.l ...
- ubuntu下安装chrome浏览器和flash插件
chrome浏览器可在Ubuntu软件中心里搜索并安装 falsh插件首先去官网下载合适的包然后,按照readme安装,执行sudo cp -r usr/* /usr 和sudo cp libflas ...
- Ubuntu12.04 下安装Chrome浏览器
第一步 下载. 32位:https://dl.google.com/linux/direct/google-chrome-stable_current_i386.deb 64位:https://dl. ...
随机推荐
- linux应用之yum命令的软件源的更换(centos)
[1] 首先备份/etc/yum.repos.d/CentOS-Base.repo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/Cent ...
- css3加载spinner
使用代码制作一个加载旋转器spinner 实现的原理是: 1.两个圆圈,其中一个圆圈是使用pseudo元素(:before)产生 2.由pseudo元素生成的圆通过负数的z-index而作用在下面 3 ...
- 【LeetCode】018 4Sum
题目: Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = ...
- nodejs 上传图片(服务端输出全部代码)
下面代码,全部都是nodejs端的,不用客户端代码.也就是,选择图片的form表单以及上传完毕预览图片的html,都是由node服务端输出的. 1 启动代码:(node upload.js) var ...
- w3c上的SQL 教程---基本语法 语句学习
SQL 教程路径:http://www.w3school.com.cn/sql/index.asp
- Java程序打包成exe可执行文件
前言: 我们都知道Java可以将二进制程序打包成可执行jar文件,双击这个jar和双击exe效果是一样一样的,但感觉还是不同.其实将java程序打包成exe也需要这个可执行jar文件. 准备: ecl ...
- Poj 1504 Adding Reversed Numbers(用字符串反转数字)
一.题目大意 反转两个数字并相加,所得结果崽反转.反转规则:如果数字后面有0则反转后前面不留0. 二.题解 反转操作利用new StringBuffer(s).reverse().toString() ...
- 2006年清华:N的阶乘
题目描述: 输入一个正整数N,输出N的阶乘. 输入: 正整数N(0<=N<=1000) 输出: 输入可能包括多组数据,对于每一组输入数据,输出N的阶乘 样例输入: 4 5 15 样例输出: ...
- nginx实现带参数目录域名重定向二级域名方法
本文章介绍了关于nginx实现带参数目录域名重定向二级域名方法,有需要学习的朋友可参考一下. 下面的代码是基于nginx的子目录301到其他域名(URL)的规则.作用是例如访问http://www.p ...
- MongoDB分析工具之二:MongoDB分析器Profile
MongoDB优化器profile 在MySQL 中,慢查询日志是经常作为我们优化数据库的依据,那在MongoDB 中是否有类似的功能呢?答案是肯定的,那就是MongoDB Database Prof ...