chromedriver 版本不匹配
selenium.common.exceptions.SessionNotCreatedException: Message: session not created
selenium.common.exceptions.WebDriverException: Message: session not created:
- 原因:
Chrome版本和ChromeDriver 版本不一致,极有可能是Chrome浏览器自动升级了新版本,导致两者版本差异,运行不了。 - 解决方案:
-
查看Chrome浏览器的版本
-
将解压后的chromedriver.exe 放在对应位置如下:
- 谷歌路径:
C:\Program Files (x86)\Google\Chrome\Application 或者C:\Program Files\Google\Chrome\Application *
python 运行目录
-
一种直接的方法是在命令行输入:where chromedriver (命令行打开方式:windows+R ,打开后键入cmd ,回车) -
 -
根据目录将chromedriver.exe 复制进去 * -
为了保险最好打开应用程序的包目录:例如E:\workplace\pycharm_workplace\conda\venv\Lib\site-packages\selenium\webdriver\chrome 复制该exe文件进去(非必要) -
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-JXVfCDzH-1643001628555)(C:\Users\HP\AppData\Roaming\Typora\typora-user-images\image-20220124131943636.png)]](https://img-blog.csdnimg.cn/997b1157a58f44dcaf287f21dbb59832.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBA6aOO6LW36aOO6YeM,size_20,color_FFFFFF,t_70,g_se,x_16)
|