一、Chrome浏览器的安装

  1. 对于谷歌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的更多相关文章

  1. CentOS7下安装chrome浏览器

    在CentOS 7环境下安装chrome浏览器 1.修改yum源 在/etc/yum.repos.d/目录下新建文件google-chrome.repo,向其中添加如下内容: [google-chro ...

  2. 在Ubuntu上安装Chrome浏览器和ChromeDriver

    启动脚本后报错 selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable may have w ...

  3. CentOS 7下安装Chrome浏览器

    1. cd /etc/yum.repos.d/ 2. vim google-chrome.repo 在该文件中输入: [google-chrome]name=google-chromebaseurl= ...

  4. Ubuntu下安装chrome浏览器步骤

    进入 Ubuntu 18.04 桌面,按下 Ctrl + Alt + t 键盘组合键,启动终端. 也可以按下 Win 键(或叫 Super 键),在 Dash 的搜索框中输入 terminal 或“终 ...

  5. ubuntu16.04下安装chrome

    1.在终端中,输入以下命令: sudo wget http://www.linuxidc.com/files/repo/google-chrome.list -P /etc/apt/sources.l ...

  6. Ubuntu16.04下安装Chrome出现“未安装软件包 libappindicator1”问题的解决办法

    1. 强制安装chrome sudo dpkg -i google-chrome-stable_current_i386.deb --force 2. 补齐依赖 sudo apt-get instal ...

  7. Ubuntu下安装chrome浏览器

    1.在终端中,输入以下命令: sudo wget http://www.linuxidc.com/files/repo/google-chrome.list -P /etc/apt/sources.l ...

  8. ubuntu下安装chrome浏览器和flash插件

    chrome浏览器可在Ubuntu软件中心里搜索并安装 falsh插件首先去官网下载合适的包然后,按照readme安装,执行sudo cp -r usr/* /usr 和sudo cp libflas ...

  9. Ubuntu12.04 下安装Chrome浏览器

    第一步 下载. 32位:https://dl.google.com/linux/direct/google-chrome-stable_current_i386.deb 64位:https://dl. ...

随机推荐

  1. Storm- Storm作业提交运行流程

    用户编写Storm Topology 使用client提交Topology给Nimbus Nimbus指派Task给Supervisor Supervisor为Task启动Worker Worker执 ...

  2. python循环切片

    x = [0,99, 'a', 1, 2, 'b',5, 3, 0,'a' ,1, 8, 5,'b',5,9,5] b=[] c=[] d=[] for i in range(len(x)): if ...

  3. 未测试 Delphi读写UTF-8、Unicode格式文本文件

    // UTF-8文件写入函数 procedure SaveUTFFile(const FileName: string; S: string; WriteHeader: Boolean = True) ...

  4. c语言代码风格

    简要:主要介绍了K&R风格和Allman(BSD)风格之间的缩进大小和大括号位置等区别 关于其它的代码风格,详见:Indent style - Wikipedia. 1.K&R sty ...

  5. 与STL文件相关的各类学习地址

    几个网址: 1.STL :https://en.wikipedia.org/wiki/STL_(file_format)#ASCII_STL 2.一个博客的文章地址: 三维图形数据格式 STL的 读取 ...

  6. Unity3D连接WCF

    Unity3D连接WCF: 一.最简单的案例 1.VS2015中: (1)建立WCF应用服务程序ForUnity: (2)将自动生成的IService1.cs与Service1.svc删除:   (3 ...

  7. Centos7部署NFS

    server1:192.168.1.189   ###客户端 server2:192.168.1.190    ##服务端 1.首先创建共享目录. mkdir -p /data/share 安装nfs ...

  8. Java企业微信开发_06_素材管理之上传本地临时素材文件至微信服务器

    一.本节要点 1.临时素材有效期 media_id是可复用的,同一个media_id可用于消息的多次发送(3天内有效) 2.上传文件时的http请求里都有啥 具体原理可参看: 为什么上传文件的表单需要 ...

  9. jQuery插件--图片文字向上向左循环滚动

    需要引用jquery 调用非常简单: 一. 向上滚动 $(".scroll_two").jScroll({vertical: true}); <div class=" ...

  10. D. String Game 二分加字符串匹配

    题目链接 题目大意:给出字符串str1,再第二行给出字符串str2,第三行给出删除str1中的字符的顺序,用数组a[]存,问最多按第三行的顺序删除str1中的字符剩下的字符串中str2 我们定义l为a ...