title: Turning on debug output for python 3 urllib
body: <p>In python 2, it was possible to get debug output from urllib by doing</p>
  
  <pre><code>import httplib
  import urllib
  httplib.HTTPConnection.debuglevel = 1
  response = urllib.urlopen('http://example.com').read()
  </code></pre>
  
  <p>However, in python 3 it looks like this has been moved to </p>
  
  <pre><code>http.client.HTTPConnection.set_debuglevel(level)
  </code></pre>
  
  <p>However, I'm using urllib not http.client directly. How can I set it up so that my http request display debugging information in this way?</p>
  
  <p>Here's what I"m using so far. What's the best way to proceed if I want to be able to get debug information?</p>
  
  <pre><code>#Request Login page
  cookiejar = http.cookiejar.CookieJar()
  opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cookiejar))
  request = urllib.request.Request(options.uri)
  add_std_headers(request)
  response = opener.open(request)
  response_string = response.read().decode("utf8")
  # ...
  </code></pre>