Selenium异常StaleElementReferenceException

问题描述

获取页面1的一批超链接,循环跳转进超链接后,再跳转回来容易引发StaleElementReferenceException异常

selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the page document

解决方案

在循环中再次获取元素find_elements_by_xxx()




参考文献

  1. selenium+python之异常StaleElementReferenceException
发布了223 篇原创文章 · 获赞 63 · 访问量 12万+

猜你喜欢

转载自blog.csdn.net/lly1122334/article/details/103502913