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
I just queried the same question which is now over 5 years old.
Please note that the URL given is also old, so i substituted the python welcome page.
We can use the requests module in python 3.
I use python 3 and the solution is below:
import requests
r = requests.get('https://www.python.org/')
t = r.text
print(t)
This works and is clean.