I am just trying to fetch data from a live web by using the urllib module, so I wrote a simple example
Here is my code:
import urllib
sock = urllib
In Python3 you can use urllib or urllib3
urllib:
import urllib.request
with urllib.request.urlopen('http://docs.python.org') as response:
htmlSource = response.read()
urllib3:
import urllib3
http = urllib3.PoolManager()
r = http.request('GET', 'http://docs.python.org')
htmlSource = r.data
More details could be found in the urllib or python documentation.