file.gz
. This is one of my favorite solutions, from Downloading a picture via urllib and python.urllib
library, and it will directly retrieve the file form a source.EDIT:
If you still want to use requests, take a look at this question or this one.URLopener
is deprecated.And when used you will get error as below: