Skip to content

Instantly share code, notes, and snippets.

@SarahElson
Last active August 12, 2022 14:37
Show Gist options
  • Save SarahElson/552e4b3139282ac98f23c72531a58fee to your computer and use it in GitHub Desktop.
Save SarahElson/552e4b3139282ac98f23c72531a58fee to your computer and use it in GitHub Desktop.
How To Download File Using Selenium Python?
import unittest
from selenium import webdriver
class Browser(unittest.TestCase):
def setUp(self):
PATH = "/Users/macbookair/Desktop/how_download_files_selenium_python/download" #This path must be modified according to your OS and the directory where you want to save your file
self.driver.get("https://www.lambdatest.com/selenium-playground/")
def tearDown(self):
self.driver.close()
if __name__ == '__main__':
unittest.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment