Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘NewConnectionError(‘<urllib3.connection.HTTPConnection object at 0x7ffeea688d30>: Failed to establish a new connection: [Errno 111] Connection refused’)’: /session/6adad5df-62b9-4032-99bb-b1c7848a7075/element/dfcda924-f4a0-42c1-8bd8-faf732ca18db/text
这里主要错误是 Max retries exceeded with url:
记一个bug,使用selenium.webdriver.Chrome().find_XX_XXX()获得的元素,必须在brower.close()或者brower.quit()使用,因为此时的元素是要依赖brower连接的
所以解决办法是把获取的元素的text获取出来,然后再关闭brower
转发学习
————————————————
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/API_demo/article/details/112323533