crawler.py 文件源码

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

项目:MercrediFiction 作者: Meewan 项目源码 文件源码
def to_text(html, rehtml=False):
    parser = HTML2Text()
    parser.wrap_links = False
    parser.skip_internal_links = True
    parser.inline_links = True
    parser.ignore_anchors = True
    parser.ignore_images = True
    parser.ignore_emphasis = True
    parser.ignore_links = True
    text = parser.handle(html)
    text = text.strip(' \t\n\r')
    if rehtml:
        text = text.replace('\n', '<br/>')
        text = text.replace('\\', '')
    return text
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号