collect.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:Qkou_kit 作者: pddg 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号