[Python] Python Selenium download button click

Discussão em 'Python' iniciado por Stack, Maio 8, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to download some reports from amex site. site screenshot [​IMG]

    I faced a problem that the download button is not visible/clickable for the selenium.


    selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element is not clickable at point (888, 869)
    ​

    This is my code:

    from selenium import webdriver
    from selenium.webdriver.common.keys import Keys
    from selenium.webdriver.common.by import By
    from selenium.webdriver.support.ui import WebDriverWait
    from selenium.webdriver.support import expected_conditions as EC
    from selenium.webdriver.common.action_chains import ActionChains
    import time

    browser = webdriver.Chrome()
    browser.maximize_window()

    browser.get('https://merchant-global.americanexpress.com/login?TARGET=https%3A%2F%2Fmerchants-r1.americanexpress.com'
    '%2Fen-us%2Fbusiness%2Fmerchant%2Fpayments%2Ftransactions')

    browser.find_element(By.ID, 'user_id').send_keys('')
    browser.find_element(By.ID, 'password').send_keys('')
    browser.find_element(By.ID, 'password').send_keys(Keys.ENTER)
    WebDriverWait(browser, 20).until(EC.element_to_be_clickable((By.ID, "open-download-flyout-transactions"))).click()
    #WebDriverWait(browser, 4).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="filter-container-download-filter-transactions"]'))).click()
    WebDriverWait(browser, 4).until(EC.element_to_be_clickable((By.ID, 'searchTransactions-download-apply-button'))).click()
    #element = browser.find_element(By.ID, 'searchTransactions-download-apply-button')
    time.sleep(5)


    [​IMG]

    Continue reading...

Compartilhe esta Página