查看domain的whois信息

python3 亲试可行

1、pip install python-whois

2、

def is_registered(domain_name):
    """
    A function that returns a boolean indicating 
    whether a `domain_name` is registered
    """
    try:
        w = whois.whois(domain_name)
    except Exception:
        return False
    else:
        return bool(w.domain_name)

  

posted @ 2021-05-21 14:56  哈哈哈喽喽喽  阅读(97)  评论(0编辑  收藏  举报