dom_parser.py 文件源码

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

项目:plugin.video.exodus 作者: lastship 项目源码 文件源码
def __get_attribs(element):
    attribs = {}
    for match in re.finditer('''\s+(?P<key>[^=]+)=\s*(?:(?P<delim>["'])(?P<value1>.*?)(?P=delim)|(?P<value2>[^"'][^>\s]*))''', element):
        match = match.groupdict()
        value1 = match.get('value1')
        value2 = match.get('value2')
        value = value1 if value1 is not None else value2
        if value is None: continue
        attribs[match['key'].lower().strip()] = value
    return attribs
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号