Download and save file using Python Requests

leave a comment »

Download and save a file using the Python requests library.

url = URL to download
filename = Name of local file for url

import requests

url = ''

response = requests.get(url)
with open(filename, 'wb') as f:

Written by M Kapoor

February 2, 2017 at 4:46 pm

Posted in python

Tagged with ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: