第二种方法里,为什么出现'Request' object has no attribute 'urlopen'
import urllib.request
import http.cookiejar
url="http://www.baidu.com"
cj=http.cookiejar.CookieJar()
opener=request.build_opener(request.HTTPCookieProcessor(cj))
request.install_opener(opener)
response=request.urlopen(url)
print(response.getcode())
print("第二种方法")
request=request.Request(url)
request.add_header("user-agent","Mozilla/5.0")
response2=request.urlopen(request)
print(response2.getcode())
print(response2.read())