I am trying to wait for "Agree&Continue" button to showup and interact with .click()
The button basically starts off with a "continue button", then it changed to "Agree and continue".
Before "continue" button:
<button class="ppvx_btn___5-8-2" aria-live="assertive" id="payment-submit-btn" data-testid="submit-button-initial" data-disabled="true" xpath="1">Continue<span class="ppvx_btn--state__screenreader___5-8-2"></span></button>
After "Agree and continue" button:
<button class="ppvx_btn___5-8-2" aria-live="assertive" id="payment-submit-btn" data-testid="submit-button-initial" data-disabled="false" xpath="1">Agree & Continue<span class="ppvx_btn--state__screenreader___5-8-2"></span></button>
What I've tried:
mainagree = WebDriverWait(driver, 20).until(
EC.presence_of_element_located((By.XPATH, "//button[@id='payment-submit-btn'][@data-
disabled='false']")).click()
print('clicked')
It works some times, but it's not consistent.
Sometimes, I think it clicked the previous button that's "continue" button and when it doesn't work, I got this error message:
selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element is not clickable at point (951, 965)
(Session info: chrome=91.0.4472.27)