I keep getting this error, and while I fixed it for another element, I can't fix it for this one. I think it's because for the other element I could find_by_ID, whereas this element does not have an ID.
while True:
try:
driver.find_element_by_name('commit')
break
except (NoSuchElementException, StaleElementReferenceException):
time.sleep(1)
wait=WebDriverWait(driver, 10,ignored_exceptions=ignored_exceptions).until(EC.presence_of_element_located((By.NAME, 'commit')))
driver.find_element_by_css_selector('input.button').click()
Error:
selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the page document
Reference page: http://www.supremenewyork.com/shop/shirts/go8jt7kse/f74y2ihpz
Specific HTML element:
<input type="submit" name="commit" value="add to cart" class="button" />