Python Selenium 程序在启动后 2~3 小时后终止。看起来像是 WebSocket 连接问题。请教我
Python Selenium program terminates after 2~3 hours since it started. It seems like WebSocket Connection Problem. Please teach me
我正在使用 Python Selenium 制作一个自动化程序。
该程序应每天 24 小时运行。
但是每当我启动程序,2小时30分钟后,它会自动终止。
不知道是什么问题
但是我在 'Chrome Driver Console' 和 'Webpage Development Tool Console' 上看到了 web socker 错误。
请看附件。
我该如何解决这个问题?
任何以 5XX 开头的错误代码都表示服务器错误,在您的情况下,您会收到 502 和 504 错误,简而言之,可以总结如下。
502/504 errors usually indicate that a computer, one that the website you're getting the 504 message on doesn't control but relies on, isn't communicating with it quickly enough.
这很可能是selenium响应不够引起的。 selenium 的最大 运行 时间为 1800 秒(30 分钟),但可以更改 caps['max_duration'] = Integer
以测试更长的时间。
我认为最高值是 14400 秒(4 小时),这大致表明了您收到错误的原因。我的建议是每 2.30 小时重新开始测试。
我正在使用 Python Selenium 制作一个自动化程序。
该程序应每天 24 小时运行。
但是每当我启动程序,2小时30分钟后,它会自动终止。
不知道是什么问题
但是我在 'Chrome Driver Console' 和 'Webpage Development Tool Console' 上看到了 web socker 错误。
请看附件。
我该如何解决这个问题?
任何以 5XX 开头的错误代码都表示服务器错误,在您的情况下,您会收到 502 和 504 错误,简而言之,可以总结如下。
502/504 errors usually indicate that a computer, one that the website you're getting the 504 message on doesn't control but relies on, isn't communicating with it quickly enough.
这很可能是selenium响应不够引起的。 selenium 的最大 运行 时间为 1800 秒(30 分钟),但可以更改 caps['max_duration'] = Integer
以测试更长的时间。
我认为最高值是 14400 秒(4 小时),这大致表明了您收到错误的原因。我的建议是每 2.30 小时重新开始测试。