Trying To Click Continue Button On Paypal With Selenium In Python
Solution 1:
Based on discussion in another thread here, let's try two different approaches for syncing and clicking the button:
agree_ctn_button = WebDriverWait(driver, 15).until(EC.presence_of_element_located((By.XPATH, "//div[contains(@class, 'modal-foreground-container')]//div[contains(@class, 'CheckoutButton_buttonWrapper')]//button[@id='payment-submit-btn']"))) driver.execute_script("arguments[0].scrollIntoView();", agree_ctn_button) driver.execute_script("arguments[0].click();", agree_ctn_button)
OR
agree_ctn_button = WebDriverWait(driver, 15).until(EC.presence_of_element_located((By.XPATH, "//div[contains(@class, 'modal-foreground-container')]//div[contains(@class, 'CheckoutButton_buttonWrapper')]//button[@id='payment-submit-btn']"))) driver.execute_script("document.getElementById('payment-submit-btn').click()")
Do either of these code snippets work?
Solution 2:
mainagree = WebDriverWait(driver, 15).until(
EC.presence_of_element_located((By.XPATH, "//button[@id='payment-submit-btn']"))
)
driver.execute_script("arguments[0].click();", mainagree)
Try the following out to click on the mainagree button. If it's in an iframe you'd get NosuchElement error.
Post a Comment for "Trying To Click Continue Button On Paypal With Selenium In Python"