【已解决】Python Selenium chromedriver Pycharm闪退的问题

概要

根据不同的业务场景需求,有时我们难免会使用程序来打开浏览器进行访问。本文在pycharm中使用selenium打开chromedriver出现闪退问题,根据不断尝试,最终找到的问题根本是版本问题。

代码如下

python 复制代码
# (1) 导入selenium
from selenium import webdriver

# (2) 创建浏览器操作对象
browser = webdriver.Chrome()
# 访问网址
url = 'https://www.jd.com/'
browser.get(url)

问题解决------>降低selenium版本:

导致闪退出现的selenium版本为 4.20.0,降低版本为 4.5.0即可解决该问题:

相关推荐
金銀銅鐵4 小时前
[Python] 从《千字文》中随机挑选汉字
后端·python
cup119 小时前
[技术复盘] Windows Python 打包实战:Nuitka 环境踩坑总结与 CI 自动化构建全指南
python·ai·环境变量·ci·nuitka·skill
aqi0011 小时前
15天学会AI应用开发(七)有了大模型为什么还要引入RAG
人工智能·python·大模型·ai编程·ai应用
金銀銅鐵13 小时前
用 Python 实现 Take-Away 游戏
python·游戏
copyer_xyf13 小时前
Agent 流程编排
后端·python·agent
copyer_xyf14 小时前
Agent RAG
后端·python·agent
copyer_xyf14 小时前
【RAG】向量数据库:milvus
后端·python·agent
copyer_xyf14 小时前
Agent 记忆管理
后端·python·agent
星云穿梭1 天前
用Python写一个带图形界面的学生管理系统——完整教程
python