๐Ÿ“– Python Web Scraping /
Module: Web Scraping

Downloading files

๐Ÿ“– Python Web Scraping / Web Scraping / Downloading files

Using urlretrieve

We can use urlretrieve from urllib.request module to download file.

For example, we can download geckdriver.zip file from their Github repository with the following code.

from urllib.request import urlretrieve
url = "https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-win64.zip"
filename = urlretrieve(url, "geckodriver.zip")

print(filename)