1import requests
2file_url = "http://1.droppdf.com/files/5iHzx/automate-the-boring-stuff-with-python-2015-.pdf"
3
4r = requests.get(file_url, stream = True)
5
6with open("/content/gdrive/My Drive/python.pdf", "wb") as file:
7 for block in r.iter_content(chunk_size = 1024):
8 if block:
9 file.write(block)
10