1、下载chromedriver.exe 入在chrome 浏览器目录下

from selenium import webdriver
import os

chromedriver = "C:\Users\AppData\Local\Google\Chrome\Application\chromedriver.exe"

os.environ["webdriver.chrome.driver"] = chromedriver

driver =  webdriver.Chrome(chromedriver)

driver.get("http://baidu.com")

driver.quit()

python selenium 操作chrome的更多相关文章

  1. Selenium操作Chrome模拟手机浏览器

    目录 使用指定设备 使用自定义设备 在使用Chrome浏览网页时,我们可以使用Chrome开发者工具模拟手机浏览器,在使用Selenium操作Chrome时同样也可以模拟手机浏览器.主要有以下两种用途 ...

  2. ubuntu 安装 selenium selenium操作 chrome

    重装虚拟机,好多包需要重装,sele这个记得当时就找了好久的完整重装方法,这次又找了好久,,,省的下次再这样,记录下来..... ubuntu16.04 4安装seleniumsudo pip ins ...

  3. Python selenium.webdriver.chrome.options.Options() Examples

    The following are 27 code examples for showing how to use selenium.webdriver.chrome.options.Options( ...

  4. python+selenium调用chrome打开网址获取内容

    目录 1,安装selenium和配置chromedriver 2,调用chromedriver打开网页获取网页内容 3,模拟登陆百度云 附录(webdriver版本兼容列表) 通过selenium库, ...

  5. Python3.5+selenium操作Chrome浏览器

    1.安装selenium 命令提示符下输入: pip install selenium 2.下载chromedriver 点击下载 3.将解压后的chromedriver.exe放到chrome浏览器 ...

  6. python selenium设置chrome的下载路径

    python可以通过ChromeOptions设置chrome参数,如下载路径等,代码如下(python 3.6.7): #-*-coding=utf-8-*- from selenium impor ...

  7. Python + Selenium操作一:截图详解

    在做测试的时候,空口无凭都是白掐,特别是自动化测试的时候,更需要图片来佐证自己发现的问题 话不多说,直接进入主题,技术就是这么直白 Webdriver自带截图功能,get_screenshot_as_ ...

  8. Python+Selenium与Chrome如何进行完美结合

    zhuan:http://blog.51cto.com/starpoint/2102975?cid=704621 使用WebDriver在Chrome浏览器上进行测试时,需要从http://chrom ...

  9. windiows下搭建python+selenium+unittest+Chrome的Web自动化环境

    一.selenium.unittest概念 Selenium 是用于测试 Web 应用程序用户界面 (UI) 的常用框架.它是一款用于运行端到端功能测试的超强工具.您可以使用多个编程语言编写测试,并且 ...

随机推荐

  1. 获取公网IP

    private static string GetIP() { string tempip = ""; try { WebRequest wr = WebRequest.Creat ...

  2. 怎么使用CDR中排列对象功能

    通过将对象发送到其他对象的前面或者后面,可以更改图层或页面上对象的堆叠顺序,还可以将对象按堆叠顺序精确定位,并且可以反转多个对象的堆叠顺序.本教程将详解CorelDRAW中排列对象各按钮功能. 1. ...

  3. Asp.net MVC 的八个扩展点

    http://www.cnblogs.com/richieyang/p/5180939.html MVC模型以低耦合.可重用.可维护性高等众多优点已逐渐代替了WebForm模型.能够灵活使用MVC提供 ...

  4. mongodb 3 常用命令操作

    操作命令详见,这个归类很好,有些教程乱麻麻的 http://www.tuicool.com/articles/j2ueau db.createUser({user:"zhihuiroot&q ...

  5. 解决“动软代码生成器在SqlServer中会将唯一索引识别为主键"的Bug

    动软代码生成器在SqlServer中,生成的代码会将唯一索引错误地识别为主键, 反编译源代码后,发现其中的SQL条件有误,现修复此Bug. 修复方法:将附件中的”Maticsoft.DbObjects ...

  6. 山东省选 郁闷的小J

    小J是国家图书馆的一位图书管理员,他的工作是管理一个巨大的书架.虽然他很能吃苦耐劳,但是由于这个书架十分巨大,所以他的工作效率总是很低,以致他面临着被解雇的危险,这也正是他所郁闷的. 具体说来,书架由 ...

  7. 使用ionic framework创建一个简单的APP

    ionic是一个以cordova为基础的html5前端框架,功能强大,能够快速做出与原生开发相似的应用. 一,安装和配置 1,安装(前提:cordova环境配置完成) npm install -g i ...

  8. The server encountered an internal error that prevented it from fulfilling this request.

    type Exception report message Request processing failed; nested exception is org.mybatis.spring.MyBa ...

  9. i2c 读写

    在I2C设备读取,必须是在同一个周期内. 一个例子,可以同时读出两个值 int read_register_double_value(int reg_addr, unsigned char *valu ...

  10. 一次Redis的使用Bug记录(exec)

    博主在一次项目中,使用了工具类中的Redis类,因为该Redis没有封装管道pipeline和exec命令,所以就大笔一挥来了一段__call; 代码如下(其中$this->_connect() ...