Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98787

Python with Selenium "element is not attached to the page document"

$
0
0

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?


Viewing all articles
Browse latest Browse all 98787

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>