curriculum.py 文件源码

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

项目:MSTU_scraper 作者: rrr3371 项目源码 文件源码
def parse_notes(self):
        notes = []
        #??????????? ????????? ???? ?????? ??????? ??? ?????
        for tag in self.page.find_all(class_='div-comment'):
            sibling = tag.next_sibling.next_sibling if type(tag.next_sibling) is NavigableString else tag.next_sibling
            if sibling and not (sibling.has_attr('class') and 'div-control' in sibling['class']):
                note = tag.get_text()
                if note.startswith('?????(?):'):
                    notes.append({'name':'authors', 'value':note[10:].strip()})
                elif note.startswith('??????????:'):
                    notes.append({'name':'comment', 'value':note[12:].strip()})
                else:
                    raise NotImplementedError('??????????? ????? ? ??????????: {}'.format(note))
        return notes
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号