I have a python function that should click through all options of a product:
submit_button = driver.find_element_by_id('quantityactionbox')
elementList = submit_button.find_elements_by_tag_name("option")
for x in elementList:
x.click()
After I clicked 2 elements I get this error:
selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the page document
Can you maybe tell me why this error appaer and what can I do to go successfully through all elements?