import urllib.request
html = urllib.request.urlopen("https://habr.com/ru/all/")
print (html)
<http.client.HTTPResponse object at 0x0259CF10>
>>> import urllib.request
>>> import urllib.parse
>>> params = urllib.parse.urlencode({'spam': 1, 'eggs': 2, 'bacon': 0})
>>> url = "http://www.musi-cal.com/cgi-bin/query?%s" % params
>>> with urllib.request.urlopen(url) as f:
... print(f.read().decode('utf-8'))
Что не так?
print(html.read().decode('utf-8'))