python3,request.add_header("user-agent","Mozilla/0.5")
print("second")
request = urllib.request.urlopen(url) #这句代码报错 request.add_header("user-agent","Mozilla/0.5")
AttributeError: 'HTTPResponse' object has no attribute 'add_header'request.add_header("user-agent","Mozilla/0.5")
response2 = urllib.request.urlopen(request)
print(response2.getcode())
print(len(response2.read()))
请求大佬帮忙看一下是啥问题?