go-rod / rod

A Chrome DevTools Protocol driver for web automation and scraping.
https://go-rod.github.io
MIT License
5.01k stars 328 forks source link

Rod Docker 如何监听浏览器存活状态 #978

Closed endachao closed 7 months ago

endachao commented 7 months ago

目前使用了 rod 的 docker 镜像部署浏览器,请问一下如何监听 docker 里面的浏览器状态,有问题的时候自动重启。

谢谢

github-actions[bot] commented 7 months ago

Please add a valid Rod Version: v0.0.0 to your issue. Current version is v0.114.5

generated by check-issue

ysmood commented 7 months ago

可以用这个方法,返回异常就可以重启了。

https://github.com/go-rod/rod/blob/d2ad7cbe8c7a6d777b7c35c966df6944bf108d3a/browser.go#L541