index.py 文件源码

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

项目:jira_worklog_scanner 作者: pgarneau 项目源码 文件源码
def __init__(self, content, url, headers=None):
        # Determine if we have any encoding information in our headers
        encoding = None
        if headers and "Content-Type" in headers:
            content_type, params = cgi.parse_header(headers["Content-Type"])

            if "charset" in params:
                encoding = params['charset']

        self.content = content
        self.parsed = html5lib.parse(
            self.content,
            transport_encoding=encoding,
            namespaceHTMLElements=False,
        )
        self.url = url
        self.headers = headers
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号