1、最简单
import urllib.request as request
url = 'http://test.llq.com/test.html'
resp = request.urlopen(url)
print(resp.read().decode('utf-8'))
2、使用 Request
import urllib.request as request
url = 'http://test.llq.com/test.html'
req = request.Request(url)
resp = request.urlopen(req)
print(resp.read().decode('utf-8'))