我應該通過產品的所有選項單擊一個Python函數:Python和硒「元素不附加到頁面文件」
submit_button = driver.find_element_by_id('quantityactionbox')
elementList = submit_button.find_elements_by_tag_name("option")
for x in elementList:
x.click()
之後,我點擊了2個元素我得到這個錯誤:
selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the page document
你能告訴我爲什麼這個錯誤設計器和我能做些什麼來成功地通過所有元素?