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

摘要:
问题:ft19.1:回溯(mostrecentcallback):文件“D:jenkinsworkspacePT4_0_UI_Scriptist_caseSystem_Managementest_OData_permissions_update.py”,第14行,insetPDriver=get_ driver()文件”../..common_modulesPT4_Log
问题:
ft19.1: Traceback (most recent call last): File "D:jenkinsworkspacePT4_0_UI_Script est_caseSystem_Management est_OData_permissions_update.py", line 14, in setUp driver = get_driver() File "../..common_modulesPT4_Login.py", line 12, in get_driver driver = webdriver.Chrome() File "D:Pythonlibsite-packagesseleniumwebdriverchromewebdriver.py", line 69, in __init__ desired_capabilities=desired_capabilities) File "D:Pythonlibsite-packagesseleniumwebdriver emotewebdriver.py", line 90, in __init__ self.start_session(desired_capabilities, browser_profile) File "D:Pythonlibsite-packagesseleniumwebdriver emotewebdriver.py", line 177, in start_session response = self.execute(Command.NEW_SESSION, capabilities) File "D:Pythonlibsite-packagesseleniumwebdriver emotewebdriver.py", line 236, in execute self.error_handler.check_response(response) File "D:Pythonlibsite-packagesseleniumwebdriver emoteerrorhandler.py", line 192, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary (Driver info: chromedriver=75.0.3770.90 (a6dcaf7e3ec6f70a194cc25e8149475c6590e025-refs/branch-heads/3770@{#1003}),platform=Windows NT 10.0.14393 x86_64)

解决方案:
1、浏览器版本和webdriver版本对应
2、浏览器取消自动升级功能(删掉update文件夹下面的所有文件,设置update文件夹不允许任何操作)
3、把下载的 chromedriver.exe 复制到以下路径
1)python 根目录
2)D:PythonLibsite-packagesseleniumwebdriver
3)C:UsersAdministratorAppDataLocalGoogleChromeApplication
4)环境变量path中添加:C:/Users/Administrator/AppData/Local/Google/Chrome/Application/chromedriver.exe
4、完成以上所有设置,新建python文件测试
代码如下:

from selenium import webdriver
import time
option = webdriver.ChromeOptions()
option.binary_location=r'D:GoogleChromeApplicationchrome.exe'
driver=webdriver.Chrome('C:/Users/Administrator/AppData/Local/Google/Chrome/Application/chromedriver.exe')
driver.get("https:www.baidu.com")
time.sleep(10)
driver.quit()

免责声明:文章转载自《selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇Ubuntu 20.04 设置 DNS 的方法使用NPOI读取Excel出错下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

Thinkphp6笔记七:控制器/模型基类配置

创建基类的目的:创建(应用admin、index、wap)公有部分,方便子类继承,能够各种灵活调用 1.common控制器基类配置 common/controller/CommonBase.php <?php namespace appcommoncontroller; /** * common控制器基类 * */ classCommonBase...

如何解决webpack中css背景图片的绝对地址

 在项目开发中,一般写相对路径是没有问题的,但是在项目比较大的情况下,我的scss文件可能为了方便管理,会放在不同的文件夹下,有的可能又不需要放在文件夹下,比如我的scss文件结构如下:  module    common.scss    test.scss about    about.scss    login.scss index.scss 比如目录...

.net core开发 (一)

1..net core: 是微软开发的另外一个可以跨平台的.net 2..net framework,.net core, mono的关系三者都是.net在不同操作系统的实现 3. .net core版本.net core 1.1 -> .net core 2.0 preview -> .net core 2.0 4. linux安装.net...

百度UEditor在线编辑器的配置和图片上传

前言       最近在项目中使用了百度UEditor富文本编辑器,配置UEditor过程中遇到了几个问题,在此记录一下解决方案和使用方法,避免以后使用UEditor出现类似的错误。 基本配置 一、下载UEditor.NET版本开发包。 UEditor可以到 http://ueditor.baidu.com/website/download.html#ue...

MySQL crc32 &amp;amp; crc64函数 提高字符串查询效率

一、CRC32概念 CRC全称为Cyclic Redundancy Check,又叫循环冗余校验。CRC32是CRC算法的一种,常用于校验网络上传输的文件。 二:MySQL里如何利用CRC32来加快查询??? CRC32的基本特征 #1.CRC32函数返回值的范围是0-4294967296(2的32次方减1) #2.相比MD5,CRC32函数很容易碰撞...

PHP 设计模式 笔记与总结(5)PHP 魔术方法的使用

PHP 魔术方法的使用 ① __get/__set:将对象的属性进行接管 当访问一个不存在的对象属性时: index.php <?php define('BASEDIR',__DIR__); //定义根目录常量 include BASEDIR.'/Common/Loader.php'; spl_autoload_register('\Commo...