Adapt the following snippet to remove the sleep time when waiting for the download button to appear:
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
delay = 40
download_button = WebDriverWait(driver, delay).until(
EC.presence_of_element_located(
(By.XPATH, '//a[text()="Download"]')
)
)
download_button.click()
Adapt the following snippet to remove the sleep time when waiting for the download button to appear: