使用Chrome浏览器时,经常会遇到以下报错:浏览器没有调用起来

selenium.common.exceptions.WebDriverException: Message: unknown Error: cannot find Chrome binary

通常由两种问题引起的:

1.ChromeDriver.exe驱动有问题(包括版本,路径等等)

2.Chrome.exe本身有问题。

解决方案:三个

1.指定chromedriver.exe驱动绝对路径

    driver = webdriver.Chrome(r'd:\xxx\chromedriver.exe')

2.添加chrome.exe到系统path环境变量

3.在代码中指定chrome.exe绝对路径。设置binary_location属性

    option = webdriver.ChromeOptions()
option.binary_location=r'C:\Users\Administrator\AppData\Local\Google\Chrome\Application\chrome.exe'
driver = webdriver.Chrome()
driver.get('https://www.baidu.com')

selenium.common.exceptions.WebDriverException: Message: unknown Error: cannot find Chrome binary的更多相关文章

  1. robotframework执行用例时,报错selenium.common.exceptions.WebDriverException: Message: unknown error: cannot get automation extension from unknown error: page could not be found: chrome-extension://aapnijgdinl

    在用robotframework编写移动端测试用例(用chrome浏览器模拟手机浏览器),执行用例时, 报错selenium.common.exceptions.WebDriverException: ...

  2. 【Python + Selenium】初次用IE浏览器之报错:selenium.common.exceptions.WebDriverException: Message: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones.

    初次用IE浏览器运行自动化程序时,报错:selenium.common.exceptions.WebDriverException: Message: Unexpected error launchi ...

  3. 【Selenium】【BugList6】调用IE,未启用保护模式,报:selenium.common.exceptions.WebDriverException: Message: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones.

    >>> driver = webdriver.Ie() 解决方法: 1.打开Ie浏览器 , 工具 ->Internet选项 ->安全 2.去掉4个区域的安全保护模式

  4. selenium启动IE浏览器报错:selenium.common.exceptions.WebDriverException: Message: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode mu

    意思是浏览器的保护模式设置不一致所导致 解决方案-->修改IE设置 将所有区域的保护模式勾选去掉即可

  5. selenium.common.exceptions.WebDriverException: Message: u'unknown error: cannot get automation extension\nfrom unknown error: page could not be found: chrome-extension://aapnijgdinlhnhlmodcfapnahmbfeb

    Python2.7 selenium3.4.1在使用chrome driver时报错:selenium.common.exceptions.WebDriverException: Message: u ...

  6. Appium问题解决方案(8)- selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Could not sign with default certificate.

    背景 运行时代码报错: selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occ ...

  7. centos7 selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH

    1.查看安装的chrome浏览器版本 2.查看版本对应的驱动 https://sites.google.com/a/chromium.org/chromedriver/downloads 下载后拷贝到 ...

  8. selenium使用遇到的问题(selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH.)

    1.安装pip3 install selenium 2.使用browser=webdriver.Chrome()时报错 :selenium.common.exceptions.WebDriverExc ...

  9. python+selenium,打开浏览器时报selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH

    有一年多没写web自动化了,今天搭建环境的时候报了一个常见错误,但是处理过程有点闹心,报错就是常见的找不到驱动<selenium.common.exceptions.WebDriverExcep ...

随机推荐

  1. VS调试不能进入断点,提示当前不会命中断点还未为文档加载任何符号

    经过仔细检查后发现,是DLL版本和源码生成的DLL版本不一致,造成的! 复制新的过去,问题就解决了.

  2. oracle sql 获取本季度所有月份,上季度所有月份

    上季度所有月份: ),-ROWNUM),'YYYYMM') LAST_Q A FROM DUAL) CONNECT ; 本季度所有月份: ),-ROWNUM),'YYYYMM') LAST_Q FRO ...

  3. netty 的 JBoss Marshalling 编码解码

    一. JBoss Marshalling 简介. JBoss Marshalling 是一个Java 对象序列化包,对 JDK 默认的序列化框架进行了优化,但又保持跟 Java.io.Serializ ...

  4. Docker(一)Linux开启你的Docker之旅

    前言 Docker容器最早受到RHEL完善的支持是从最近的CentOS 7.0开始的,官方说明是只能运行于64位架构平台, 内核版本为2.6.32-431及以上(即 >= CentOS 6.5, ...

  5. Kafka中bootstrap-server、broker-list和zookeeper的区别

    参考 Kafka bootstrap-servers vs zookeeper in kafka-console-consumer  中说建议使用新版(新版本指的是kafka 0.8.0之后的版本)的 ...

  6. GraphX学习笔记——可视化

    首先自己造了一份简单的社交关系的图 第一份是人物数据,id和姓名,person.txt 1 孙俪 2 邓超 3 佟大为 4 冯绍峰 5 黄晓明 6 angelababy 7 李冰冰 8 范冰冰 第二份 ...

  7. 利用Python半自动化生成Nessus报告

    0x01 前言 Nessus是一个功能强大而又易于使用的远程安全扫描器,Nessus对个人用户是免费的,只需要在官方网站上填邮箱,立马就能收到注册号了,对应商业用户是收费的.当然,个人用户是有16个I ...

  8. Javascript 变量、函数的声明

    javascript变量 全局变量和局部变量    按照变量的作用域来区分,和大多数编程语言类似,javascript变量也分为全局变量和局部变量.全局变量的作用域是整个js文件,而局部变量的作用域是 ...

  9. js库 - 浅拷贝 & 深拷贝

    学了堆栈内存空间,应该就理解了什么叫简单数据类型存在栈内存,复杂数据类型存在堆内存了. 然后面试中经常会问.业务中也经常会遇到的问题就是深浅拷贝的问题了. 栈内存中简单数据类型直接拷贝就能得到一个副本 ...

  10. 查看java内存情况命令

    转自:http://boendev.iteye.com/blog/882479 jinfo:可以输出并修改运行时的java 进程的opts. jps:与unix上的ps类似,用来显示本地的java进程 ...