报错 selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the page document
这是代码
```python
from selenium import webdriver
import time
def tool(times, name):
for i in times:
print(i.text)
if name in i.text:
i.find_element_by_tag_name('a').click()
def start(name):
item = driver.find_element_by_xpath('//*[@id="ac-globalnav"]/div/ul[2]')
items = item.find_elements_by_xpath('li')
tool(items, name)
def model(name):
item = driver.find_element_by_xpath('//*[@id="chapternav"]/div/ul')
items = item.find_elements_by_xpath('li')
tool(items, name)
if __name__ == '__main__':
driver = webdriver.Chrome('chromedriver')
driver.get("https://www.apple.com/")
driver.maximize_window()
start('iPhone')
model('iPhone 13 Pro')