import logging, urllib.request, urllib.error, urllib.parse, sys
hh = urllib.request.HTTPHandler()
hsh = urllib.request.HTTPSHandler()
hh.set_http_debuglevel(1)
hsh.set_http_debuglevel(1)
opener = urllib.request.build_opener(hh, hsh)
logger = logging.getLogger()
logger.addHandler(logging.StreamHandler(sys.stdout))
logger.setLevel(logging.NOTSET)
How do I get urllib2 to log ALL transferred bytes