again. This is the second time I am asking this question and I really want to figure out what happens.
Summary: I want to click a "agree and continue" button on paypal with selenium. The button changes from "continue" to "agree and continue". I tried various ways of clicking it and sometimes it works, sometimes it doesn't. It prints "clicked" as it's already clicked, but it won't proceed to the next page.
"continue" button (before the change)
<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>
"agree and continue" button (after the change)
<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')
I also tried to_be_clickable
mainagree = WebDriverWait(driver, 20).until(
EC.element_to_be_clickable((By.XPATH, "//button[@id='payment-submit-btn'][@data-
disabled='false']")).click()
It works like half of the time which confuses me a lot, and sometimes I got this error when it didn't work
selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element is not clickable at point (951, 965)
(Session info: chrome=91.0.4472.27)