使用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. Web 呼起 APP

    1. iOS iOS 9+,用 universal links,可以在微信和 safari 中呼起 APP,并定位到指定 View iOS 8-,用 iframe + scheme,在微信中不可以呼起 ...

  2. Dubbo 在maven项目中的应用

    首先我们来看一下dubbo的架构: 所以通过此图,我们看到就是服务的提供者将服务注册到注册中心,服务的消费者从注册中心获取服务,monitor监控服务的调用. 关于dubbo的使用,我们举个简单的例子 ...

  3. Caffe 分类问题 Check failed: error == cudaSuccess (2 vs. 0) out of memory

    如果图片过大,需要适当缩小batch_size的值,否则使用GPU时可能超出其缓存大小而报错

  4. mac:Go安装和配置+GoLand安装和使用之完整教程

    前言 作为一个go语言程序员,觉得自己有义务为go新手开一条更简单便捷的上手之路.纵使网上教程很多,但总不尽人意.go的入门门槛还是非常低的,无论是安装还是使用. go安装 go 语言支持以下系统:  ...

  5. Python中的retry

    1.通过语言特性实现: for i in range(0,100): while True: try: # do stuff except SomeSpecificException: continu ...

  6. nginx set变量后lua无法改值

    今天在使用lua修改nginx自定义变量的时候,发现死活更改不了,如下所示: 有问题的代码 set $check "1"; rewrite_by_lua_file 'conf/ru ...

  7. ZIP解压缩工具类

    import java.io.File; import org.apache.tools.ant.Project; import org.apache.tools.ant.taskdefs.Expan ...

  8. 新版的 Springsecurity request.getRequestDispatcher).forward(request, response); 404 问题,已解决

    旧版本的 可以直接 转发登陆 request.getRequestDispatcher).forward(request, response); 新版本的转发会404,原因 SpringSecurit ...

  9. zeppelin 一直报这个警告 也是醉了

    用./zeppelin-daemon.sh start 启动zeppelin 一直报这个警告.. WARN [2017-03-23 19:11:34,461] ({qtp483422889-45} N ...

  10. Ext Js 6.2.1 classic grid 滚动条bug解决方案

    此bug未在其他版本发现,参考高版本代码重写类解决此bug,直接上代码: /** * 如果列表同时存在横向滚动条和竖向滚动条,当竖向滚动条滚动到底部时 * 点击横向滚动条,滚动条会自动滚动到顶部 * ...