scraper.py 文件源码

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

项目:open-event-scraper 作者: fossasia 项目源码 文件源码
def validate_result(current, default, type):
    """
    Validates the data, whether it needs to be url, twitter, linkedin link etc.
    """
    if current is None:
        current = ""
    if default is None:
        default = ""
    if type == "URL" and validators.url(current, require_tld=True) and not validators.url(default, require_tld=True):
        return current
    if type == "EMAIL" and validators.email(current) and not validators.email(default):
        return current
    return default
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号