request = urllib.request.Request('http://example.com/')
request.add_header('Accept-encoding', 'gzip')
response = urllib.request.urlopen(request)
Does python urllib2 automatically uncompress gzip data fetched from webpage?