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