Skip to content

Instantly share code, notes, and snippets.

@SarahElson
Last active September 28, 2022 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save SarahElson/1579e574171f060a0252bd776e0daf76 to your computer and use it in GitHub Desktop.
Save SarahElson/1579e574171f060a0252bd776e0daf76 to your computer and use it in GitHub Desktop.
How To Download File Using Selenium Python?
from selenium.webdriver.common.by import By
class SeleniumPlaygroundPageLocators(object):
#locators
file_download = (By.XPATH, '//li[.="File Download"]')
data_field = (By.XPATH, '//*[@id="textbox"]')
generate_file = (By.ID, 'create')
download_button = (By.XPATH, '//*[@id="link-to-download"]')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment