Last active
August 10, 2016 17:26
-
-
Save Adrian016/0f1f105eacc2c49f99c4997564846956 to your computer and use it in GitHub Desktop.
Download pdf from URL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
def downloadpdf(url, outfile): | |
try: | |
webFile = requests.get(url) | |
with open(outfile, 'wb') as fd: | |
for chunk in webFile.iter_content(10000): | |
fd.write(chunk) | |
except IOError: | |
print('Download Error') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment