def collect_cancel(html):
try:
cancels_list = []
for tr in html.findAll('tr', attrs={'class': re.compile('^gen_')}):
td = tr.findAll('td')
# ????
lec_cancel = map(text, td[2:9])
# ?????????
s = lec_cancel[0] + lec_cancel[1] + lec_cancel[2] + \
lec_cancel[3] + lec_cancel[4] + lec_cancel[6]
unique_hash = hashlib.sha1(s.encode('utf-8')).hexdigest()
lec_cancel.append(unique_hash)
cancels_list.append(lec_cancel)
else:
return cancels_list
except Exception as e:
log.exception(e)
评论列表
文章目录