import urllib.requesturl = 'https://www.python.org' ������������������������������������������������ req = urllib.request.Request(url) ��������������������������� response = urllib.request.urlopen(url) ������������������ print(type(response))
���������������������������������HTTPResponse������������������������������������������������������������������������������������
���������������������
- read():������������������
- fileno():���������������������
- getheader(name):������������������������
- getheaders():������������������������
- status:������HTTP���������
- reason:���������������������
- debuglevel:������������������
- closed:���������������������������
������������������
html = response.read().decode('utf-8')
print(html)
"> ���������������urllib.request.urlopen()
������������������������������������������������HTTPResponse������������������������status
������������������HTTP���������������200���������������404������������������������������������������������������������������������