一、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. ANT+JMETER集成

    一.ant安装 环境准备: 1.安装jdk http://www.oracle.com/technetwork/java/javase/downloads/index.html 注意:最好与jmete ...

  2. Luogu P1377 [TJOI2011]树的序:离线nlogn建二叉搜索树

    题目链接:https://www.luogu.org/problemnew/show/P1377 题意: 有一棵n个节点的二叉搜索树. 给出它的插入序列,是一个1到n的排列. 问你使得树的形态相同的字 ...

  3. PHP基础陷阱题(变量赋值)

    PHP基础陷阱题代码,需要的朋友可以参考下   复制代码 代码如下: <?php $a=3; $b=6; if($a=5||$b=7){ $a++; $b++; } var_dump($a, $ ...

  4. 十五 Django框架,缓存

    由于Django是动态网站,所有每次请求均会去数据进行相应的操作,当程序访问量大时,耗时必然会更加明显,最简单解决方式是使用:缓存,缓存将一个某个views的返回值保存至内存或者memcache中,5 ...

  5. 一个基于特征向量的近似网页去重算法——term用SVM人工提取训练,基于term的特征向量,倒排索引查询相似文档,同时利用cos计算相似度

    摘  要  在搜索引擎的检索结果页面中,用户经常会得到内容相似的重复页面,它们中大多是由于网站之间转载造成的.为提高检索效率和用户满意度,提出一种基于特征向量的大规模中文近似网页检测算法DDW(Det ...

  6. 大数据日志分析产品——SaaS Cloud, e.g. Papertrail, Loggly, Sumo Logic;Open Source Frameworks, e.g. ELK stack, Graylog;Enterprise Products, e.g. TIBCO LogLogic, IBM QRadar, Splunk

    Learn how you can maximize big data in the cloud with Apache Hadoop. Download this eBook now. Brough ...

  7. 了解fiddler:实现简单的抓包测试

    fiddler是一款轻型的抓包软件 本文介绍几个常用的功能:(相信图片更直观点,上图片,右键在新标签页中打开,查看高清大图) 通过composer,我们可以修改http头部信息,修改post(),ge ...

  8. eslipse 修改tomcat server location 解决HTTP Status 404 – Not Found

    Eclipse中tomcat service设置选择window ----show view---services可以看到服务的面板双击tomcat进入配置界面Service Locations(Sp ...

  9. Convolutional Neural Networks for Visual Recognition 7

    Two Simple Examples softmax classifier 后,我们介绍两个简单的例子,一个是线性分类器,一个是神经网络.由于网上的讲义给出的都是代码,我们这里用公式来进行推导.首先 ...

  10. freeMarker(八)——程序开发指南之配置(Configuration)

    学习笔记,选自freeMarker中文文档,译自 Email: ddekany at users.sourceforge.net 1.基本内容 配置(configuration)就是 freemark ...