我正在寻找一个StaleElementReferenceException的解决方案,这个解决方案是在使用Selenium导航回上一页时出现的。
下面是再现错误的示例代码:
from selenium.webdriver import Chrome
from selenium.common.exceptions import NoSuchElementException
browser = Chrome()
browser.get('https://stackoverflow.com/questions/')
# Closing the pop-up for cookies