Created
December 7, 2020 20:39
-
-
Save mberz/54b3b778611ebd47021d6b30c8b7fae4 to your computer and use it in GitHub Desktop.
Download a file using urllib3
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 urllib3 | |
| import shutil | |
| http = urllib3.PoolManager() | |
| with open(filename, 'wb') as out: | |
| r = http.request('GET', url, preload_content=False) | |
| shutil.copyfileobj(r, out) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment