xyzio

Download and save file using Python Requests

leave a comment »

Download and save a file using the Python requests library.

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

import requests

url = ''

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

Written by M Kapoor

February 2, 2017 at 4:46 pm

Posted in python

Tagged with ,

Leave a comment