Skip to content

How to disable download window prompt when a download button is clicked #2454

Answered by mdmintz
Weberworld asked this question in Q&A
Discussion options

You must be logged in to vote

There are no prompts that you need to interact with when downloading files. Example:

from seleniumbase import Driver

driver = Driver(uc=True)
try:
    driver.get("https://pypi.org/project/seleniumbase/#files")
    driver.assert_element("span#pip-command")
    driver.assert_text("Download files", "div#files h2.page-title")
    driver.assert_text("Download files", "a#files-tab")
    pkg_header = driver.get_text("h1.package-header__name").strip()
    pkg_name = pkg_header.replace(" ", "-")
    whl_file = pkg_name + "-py3-none-any.whl"
    tar_gz_file = pkg_name + ".tar.gz"
    whl_selector = 'div#files a[href$="%s"]' % whl_file
    # Click the link to download the file into: "./downloaded_f…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mdmintz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants