python - 使用 Python 和 Selenium 无法访问 chrome
问题描述
我有一个带有 selenium 的 python 脚本,大部分时间都可以正常工作。但有时,由于未知原因,Chrome 关闭并且脚本继续运行,但它尝试发送到 Chrome 的每个操作都会引发错误:
Message: chrome not reachable
(Session info: chrome=94.0.4606.71)
如果出现故障,我怎样才能捕捉到该错误并重新启动 chrome?
谢谢
解决方案
推荐阅读
- javascript - 如何为 javascript 中的inquirer.prompt 问题的答案创建函数参数(变量)?MySQL也参与其中
- c++ - 我不知道为什么这个 static_assert() 代码不起作用
- python - TypeError:列表索引必须是整数或切片,而不是str,discord py
- r - 跨列的逐行操作
- python - 检查一个列表的每个元素是否是另一个列表的所有元素的倍数
- clion - 如何在 CLion 中包装一长串值?
- c# - 与 ASP.NET MVC BeginExecuteCore 等效的 ASP.NET Core
- java - 如何使用 selenium java 在对话框中自动滚动
- html - 相对位置如何使 dom 节点在固定位置上绘制?
- java - 使用 twaitforfile 或自定义 java 代码将文件从一个目录传输到另一个目录时如何诱导时间延迟?