diff.py 文件源码

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

项目:EmojiTaco 作者: jeeftor 项目源码 文件源码
def parse_html(html, cleanup=True):
    """
    Parses an HTML fragment, returning an lxml element.  Note that the HTML will be
    wrapped in a <div> tag that was not in the original document.

    If cleanup is true, make sure there's no <head> or <body>, and get
    rid of any <ins> and <del> tags.
    """
    if cleanup:
        # This removes any extra markup or structure like <head>:
        html = cleanup_html(html)
    return fragment_fromstring(html, create_parent=True)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号