helpers.py 文件源码

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

项目:harbour-sailfinder 作者: DylanVanAssche 项目源码 文件源码
def lowercase_attr_names(tag):
    """Lower-case all attribute names of the provided BeautifulSoup tag.
    Note: this mutates the tag's attribute names and does not return a new
    tag.

    :param Tag: BeautifulSoup tag

    """
    # Use list comprehension instead of dict comprehension for 2.6 support
    tag.attrs = dict([
        (key.lower(), value)
        for key, value in iteritems(tag.attrs)
    ])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号