

from urllib import request

resp = request.urlopen("http://www.baidu.com")
print(resp.getcode()) # 获取状态码
print(resp.geturl()) # 获取url
print(resp.getheaders()) # 获取请求头
print(resp)#　查看urlopen返回值类型
print(resp.read())# 查看所有内容
print(resp.read().decode("utf-8")) # 将字节类型转化为字符串类型
print(resp.readline()) # 查看第一行内容
print(resp.readlines())#　查看所有内容，并返回在一个列表中

d3455fd166c2a3143f3d7033705efe299e5d7659
<mask token>

<mask token>
print(resp.getcode())
print(resp.geturl())
print(resp.getheaders())
print(resp)
print(resp.read())
print(resp.read().decode('utf-8'))
print(resp.readline())
print(resp.readlines())

<mask token>
resp = request.urlopen('http://www.baidu.com')
print(resp.getcode())
print(resp.geturl())
print(resp.getheaders())
print(resp)
print(resp.read())
print(resp.read().decode('utf-8'))
print(resp.readline())
print(resp.readlines())

from urllib import request
resp = request.urlopen('http://www.baidu.com')
print(resp.getcode())
print(resp.geturl())
print(resp.getheaders())
print(resp)
print(resp.read())
print(resp.read().decode('utf-8'))
print(resp.readline())
print(resp.readlines())



from urllib import request

resp = request.urlopen("http://www.baidu.com")
print(resp.getcode()) # 获取状态码
print(resp.geturl()) # 获取url
print(resp.getheaders()) # 获取请求头
print(resp)#　查看urlopen返回值类型
print(resp.read())# 查看所有内容
print(resp.read().decode("utf-8")) # 将字节类型转化为字符串类型
print(resp.readline()) # 查看第一行内容
print(resp.readlines())#　查看所有内容，并返回在一个列表中
