def getAbstractInfo(self):
try:
req = request.Request(self.url)
req.add_header('User-Agent', self.user_agent)
response = request.urlopen(req)
#bytes?????
content = response.read().decode('gbk')
self.getDetailList(content)
except error.URLError as e:
if hasattr(e,'code'):
print (e.code)
if hasattr(e,'reason'):
print (e.reason)
except error.HTTPError as e:
print('HTTPError!!!')
评论列表
文章目录