最近,许多开发者在使用ChromeDriver 126时遇到了无法找到chromedriver.exe文件的错误。本文将介绍该问题的原因,并提供详细的解决方案和示例代码。 正文问题分析ChromeDriver 126无法找到chromedriver.exe的错误通常是由于以下几个原因:下载的ChromeDriver版本与Chrome浏览器版本不匹配。 cookiecookie = {'name': 'example', 'value': 'cookie_value'}# 设置ChromeDriver路径driver_path = "/path/to/chromedriver.exe By.NAME, "q")search_box.send_keys("Selenium")search_box.submit()# 关闭浏览器driver.quit()结论ChromeDriver 126找不到chromedriver.exe 检查文件路径和权限:确保chromedriver.exe文件位于正确的目录,并具有执行权限。更新系统设置:对于macOS用户,确保系统允许运行下载的应用程序和文件。
然而,有时我们会遇到诸如“ChromeDriver版本125无法找到chromedriver.exe”的错误。 下载完成后,将chromedriver.exe放在一个便于管理的目录下,例如 C:\chromedriver\。 二、设置环境变量为了让系统识别chromedriver.exe,需要将其所在目录添加到环境变量中:右键点击“此电脑”或“我的电脑”,选择“属性”。点击“高级系统设置”。 selenium.webdriver.chrome.options import Options# 设置ChromeDriver的路径chrome_driver_path = 'C:/chromedriver/chromedriver.exe 执行抓取操作content = driver.page_sourceprint(content)# 关闭浏览器driver.quit()结论通过本文的介绍,您应该能够解决ChromeDriver 125无法找到chromedriver.exe
下载chromedriver.exe chromedriver.exe文件是调用chrome的驱动文件,因此该文件的版本要和chrome的版本必须兼容 chromedriver.exe下载地址如下:http ://chromedriver.storage.googleapis.com/index.html 其中chromedriver.exe版本很多,针对chrome(版本 65.0.3325.181)下载的是下图所示的版本 将下载的chromedriver.exe(2.37)放到(复制或移动)至chrome的安装目录下(一般chrome的安装路径如下,C:\Program Files (x86)\Google\Chrome 运行第5步的代码,极有可能会报错,给出的类似于chromedriver.exe .....path等字样的错误信息...。如何解决呢? 关闭所有打开的chrome浏览器,再次运行。
= webdriver.Chrome(r"C:\\\\Users\\\\86151\\\\AppData\\\\Local\\\\Google\\\\Chrome\\\\Application\\\\chromedriver.exe = webdriver.Chrome(r"C:\\\\Users\\\\86151\\\\AppData\\\\Local\\\\Google\\\\Chrome\\\\Application\\\\chromedriver.exe = webdriver.Chrome(r"C:\\\\Users\\\\86151\\\\AppData\\\\Local\\\\Google\\\\Chrome\\\\Application\\\\chromedriver.exe = webdriver.Chrome(r"C:\\\\Users\\\\86151\\\\AppData\\\\Local\\\\Google\\\\Chrome\\\\Application\\\\chromedriver.exe = webdriver.Chrome(r"C:\\\\Users\\\\86151\\\\AppData\\\\Local\\\\Google\\\\Chrome\\\\Application\\\\chromedriver.exe
一、概述 Selenium3.8版本以后,已经不支持PhanTomJS了,可以使用谷歌,火狐的无头浏览器来代替PhanTomJS 二、安装 确认版本 使用chrome的无头浏览器,需要下载谷歌驱动chromedriver.exe chromedriver.exe下载 淘宝的镜像下载地址 查看本机Chrome版本,打开谷歌浏览器,点击右上角的菜单,帮助-->关于Google Chrome(G) 可以看到我的版本是:84.0.4147.105 下载完后,解压到桌面里面有个chromedriver.exe文件 python获取自己的exe路径 新建脚本test.py import sys print(sys.executable) 执行输出: 将chromedriver.exe文件放到python.exe所在的路径。
3.解压并将chromedriver.exe放在chrome的安装目录下 ? 4. webdriver.Chrome(chrome_options=options,executable_path='C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe import os os.environ["webdriver.chrome.driver"] = "C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe webdriver.Chrome(chrome_options=options,executable_path='C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe
下载chromedriver.exe 查看自己对应浏览器(这里使用chrome)版本 ? 在下面这个地址去下载chromedriver.exe http://chromedriver.storage.googleapis.com/index.html ? 下载自己浏览器对应版本(我这里选择89) 配置chromedriver.exe 将下载好的文件复制到python安装路径下 通过下面python代码可以查看python安装路径 import sys print webdriver.Chrome() """未将chromedriver.ex复制到python路径下,需要这样写""" #driver = webdriver.Chrome(executable_path="chromedriver.exe 127.0.0.1:9222') driver = webdriver.Chrome(executable_path="C:/Users/Administrator/Anaconda3/envs/lyc36/chromedriver.exe
/tools/chromedriver.exe') driver.get_url('http://www.5itest.cn/register') # 设置浏览器窗口大小 print("设置浏览器宽500 /tools/chromedriver.exe') first_url = 'https://www.baidu.com/' second_url = 'https://news.baidu.com/' /tools/chromedriver.exe') browser.get(base_url) # 1. /tools/chromedriver.exe') browser.get(base_url) # 2.提交 search_text = browser.find_element_by_id('kw') /tools/chromedriver.exe') browser.get(base_url) # 3.
import sleep if __name__ == '__main__': bro = webdriver.Chrome(r"E:\google\Chrome\Application\chromedriver.exe webdriver from time import sleep bro = webdriver.Chrome(executable_path=r"E:\google\Chrome\Application\chromedriver.exe selenium.webdriver import ActionChains bro = webdriver.Chrome(executable_path=r"E:\google\Chrome\Application\chromedriver.exe webdriver from time import sleep bro = webdriver.Chrome(executable_path=r"E:\google\Chrome\Application\chromedriver.exe excludeSwitches',['enable-automation']) bro = webdriver.Chrome(executable_path=r"E:\google\Chrome\Application\chromedriver.exe
'): os.remove('chromedriver.exe') # 驱动文件存在时,先删除 print('原驱动文件 chromedriver.exe _folder = "-".join(zip\_n.split("-", 2)[:2]) zip\_ext\_full\_name = f'{zip\_ext\_folder}/chromedriver.exe ' if int(ver\_pre) == 115 else 'chromedriver.exe' # 114和115版压缩包中文件结构不相同 with ZipFile ', 1)[0] # 浏览器版本号 前3位(即3组数字,中间点分隔,例如:122.01.32) if os.path.exists('chromedriver.exe'): # 驱动文件存在, 但是和浏览器版本不符 loc\_drv\_ver = os.popen('chromedriver.exe --version').read().strip().split(' ')[1]
如果你因为无法【翻越思维的墙】而下载不了chromedriver.exe,而且巧好是 Windows 的话,可以去下面这下载 链接: https://pan.baidu.com/s/1Xz3ezvBVF4BwMYhV4pjaKg 密码: fpqc 下载回来后需要把路径记住,比如我就把 chromedriver.exe 放在了 C:/Program Files (x86)/Google/Chrome/Application/ options.add_argument("--incognito") # 隐身模式打开,可以注释掉 driver_path = "C:/Program Files (x86)/Google/Chrome/Application/chromedriver.exe
gitee.com/emaiqi/DrissionPage from DrissionPage.easy_set import set_paths driver_path = 'C:\\chrome\\chromedriver.exe ' # 你的chromedriver.exe路径,可选 chrome_path = 'D:\\chrome\\chrome.exe' # 你的chrome.exe路径,可选 set_paths(driver_path
2.查看chromedriver.exe版本号,双击这个文件就可以了,查出来版本号是V2.9 ? 3.很显然是chromedriver的版本号过低了,于是可以找个更高级的版本:V2.24 三、chromedriver 确保chromedriver.exe文件在path路径下,这里我放到Python的根目录了 2.确保驱动文件名称是chromedriver.exe,如果名称后面带版本号的,改下文件名称就行。
*- import re import time from selenium import webdriver import os from lxml import etree #如果没有配置chromedriver.exe 的环境变量,要写完整路径 # chromedriver = "C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe" chromedriver = "chromedriver.exe" browser = webdriver.Chrome(chromedriver) url = "https://www.jd.com/" browser.get
查看当前浏览器版本 最新版本为89 下载对应浏览器版本的chrome driver http://npm.taobao.org/mirrors/chromedriver/ 下载后解压至特定目录 H:\drivers\chromedriver.exe 快速启动 创建一个webdriver驱动实例 from selenium import webdriver driver_path = r"H:\drivers\chromedriver.exe" selenium import webdriver from jd_crawler.jd_parser import search import time driver_path = r"H:\drivers\chromedriver.exe
install selenium import time,json,random from selenium import webdriver (二)登录账号 在selenium安装完成后,需要下一个驱动器(即chromedriver.exe ) 【谷歌驱动器下载】 而后运行代码 driver = webdriver.Chrome(executable_path='chromedriver.exe') driver.get("https:// 部分)的cookie delete_all_cookies() 删除所有的cookie driver = webdriver.Chrome(executable_path='chromedriver.exe = "你的密码" def CSDN_login(): ''' 登录CSDN并保存cookies ''' driver = webdriver.Chrome(executable_path='chromedriver.exe cookies, fp) def dianZan(url_list): ''' 实现自动点赞功能 ''' driver = webdriver.Chrome(executable_path='chromedriver.exe
1查看当前google版本[其他浏览器也可以] 在google浏览器输入:chrome://settings/help 下载 chromedriver.exe 下载地址:http://npm.taobao.org 不会弹出浏览器,默认是后台静默运行 options.addArguments("--headless","--disable-gpu"); //注意 第二个参数 改为你第二步下载 chromedriver.exe 所放在的路径 System.setProperty("webdriver.chrome.driver", "D:/chromedriver/chromedriver.exe");
chromedriver 下载列表 https://chromedriver.storage.googleapis.com/index.html 我这里选择: 72.0.3626.69 下载好后,将 chromedriver.exe 移动到 python37/Scripts/chromedriver.exe 在 cmd 中执行 chromedriver 看到如下信息,即安装成功 Starting ChromeDriver 72.0.3626.69
timeoptions = Options()pathB = os.path.abspath(os.path.dirname(__file__))pathRes = os.path.join(pathB,'chromedriver.exe ') # 这里是你指定chromedriver.exe路径options.binary_location = os.path.join(pathB,'chrome','chrome.exe') # time.sleep(n)timer(5)# 每n秒执行一次 打包 pyintsaller xx.py --noconfirm 项目路径 打包资源 主要事项 一定一定一定要注意资源路径引用的问题 第一chromedriver.exe
可能有些读者没有把驱动配置到环境中,接下来我们可以指定驱动的位置: driver = webdriver.Chrome(executable_path=r'F:\python\dr\chromedriver_win32\chromedriver.exe ') 以上代码调用Chrome 方法并且配置驱动地址(这里使用 executable_path 指定驱动地址)为“F:\python\dr\chromedriver_win32\chromedriver.exe selenium import webdriver driver = webdriver.Chrome(executable_path=r'F:\python\dr\chromedriver_win32\chromedriver.exe selenium import webdriver driver = webdriver.Chrome(executable_path=r'F:\python\dr\chromedriver_win32\chromedriver.exe import webdriver import time driver = webdriver.Chrome(executable_path=r'F:\python\dr\chromedriver_win32\chromedriver.exe