either the element is no longer attached to the DOM, it is not in the curren
元素不再附加到DOM
解决方法
每次都重新寻找xpath,并且加上延时
while n < 30 :
path = "/html/body[@class='m-index zy']"
diyiti = dr.find_element_by_xpath(url).click()
n = n + 1
time.sleep(2)
本文探讨了在网页自动化操作中遇到的元素不再附加到DOM的问题,并提供了解决方案:通过重新查找XPath并加入延时来确保元素可以被正确识别和操作。
1178

被折叠的 条评论
为什么被折叠?



