python - Python Selenium program terminates after 2~3 hours since it started. It seems like WebSocket Connection Problem. Please teach me
问题描述
I am making an automation program using Python Selenium.
The program should be operated 24hours a day.
But whenever I started the program, after 2 hours and 30min, it automatically terminates.
I don't know what the problem is.
But I saw the web socker error presented on 'Chrome Driver Console' and 'Webpage Development Tool Console'.
Please look at the attached image.
How can I fix this?
解决方案
任何以 5XX 开头的错误代码都表示服务器错误,在您的情况下,您会收到 502 和 504 错误,简而言之,可以总结如下。
502/504 错误通常表明计算机,即您收到 504 消息的网站无法控制但依赖的计算机,与它的通信速度不够快。
这很可能是硒反应不够引起的。硒的最大运行时间为 1800 秒(30 分钟),但可以更改caps['max_duration'] = Integer
为更长的测试时间。
我认为的最高值是 14400 秒(4 小时),这大致表明了您收到错误的原因。我的建议是每 2.30 小时重新开始一次测试。
推荐阅读
- image - 在 Geopandas 的地图上使用图像作为标记
- pyspark - Pyspark FeatureImportance with RFormula
- node.js - 循环遍历 where 子句中的所有查询参数
- javascript - 使用 jquery 验证电子邮件地址
- azure - 使用 Azure 函数读取具有托管标识的服务总线消息
- visual-studio-code - VS Code Javascript智能感知不起作用
- swift - 将 Alamofire 完成处理程序转换为 Async/Await | 斯威夫特 5.5,*
- python - 仅对 DatetimeIndex、TimedeltaIndex 或 PeriodIndex 有效,但获得了“RangeIndex”实例
- sql - 比较当月销售额与上月销售额
- amazon-web-services - 创建 AWS 日志组?