title: Python urllib urlopen not working
body: <p>I am just trying to fetch data from a live web by using the urllib module, so I wrote a simple example</p>
  
  <p>Here is my code: </p>
  
  <pre><code>import urllib
  
  sock = urllib.request.urlopen("http://diveintopython.org/") 
  htmlSource = sock.read()                            
  sock.close()                                        
  print (htmlSource)  
  </code></pre>
  
  <p>But I got error like: </p>
  
  <pre><code>Traceback (most recent call last):
    File "D:\test.py", line 3, in &lt;module&gt;
      sock = urllib.request.urlopen("http://diveintopython.org/") 
  AttributeError: 'module' object has no attribute 'request'
  </code></pre>