1续语、最簡(jiǎn)單
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'))