This article mainly describes the Python module based on the simple identification of the site domain name and owner of the method, a simple analysis of the Python whois module installation and use of relevant operating skills, the need for friends can refer to the following
The examples in this paper describe the method of simple identification of website domain names and owners based on the WHOIS module. Share to everyone for your reference, as follows:
For some websites, we may care about who owns them. In order to find the owner of the site, we can use the WHOIS protocol to inquire who is the registrant of the domain name. There is a wrapper library for the protocol in Python. We can install it via PIP.
Pip Install Python-whois
Add: This machine installs the Python2 and Python3 two versions, where the PIP2 installation module is used python-whois
, as shown in:
The PIP3 installation Python-whois module for the native Python3 environment is as shown:
Import Moduleimport whois
>>> Import whois>>> Whois.whois (' https://www.cgtz.com/') {u ' updated_date ': datetime.datetime (2018 , 3, 7, Notoginseng, clienttransferprohibited), U ' status ': [u ' https://icann.org/epp#clientTransferProhibited ', U ' clientupdateprohibited https://icann.org/epp#clientUpdateProhibited ', U ' name ': U ' nexperian Holding Limited ', U ' dnssec ': U ' unsigned ', U ' city ': U ' hangzhou ', U ' expiration_date ': Datetime.datetime (2025, 7, (+), +), U ' zipcode ': U ' 311121 ', U ' domain_name ': [u ' CGTZ. COM ', U ' cgtz.com '], U ' country ': U ' CN ', U ' whois_server ': U ' grs-whois.hichina.com ', U ' state ': U ' zhejiang ', U ' Registrar ': U ' HiChina Zhicheng Technology Ltd. ', U ' referral_url ': None, U ' address ': U ' Le Jia international no.999 Liang Mu Road Yuhang District ', U ' name_servers ': [u ' VIP1. Alidns. COM ', U ' VIP2. Alidns. COM '], u ' org ': U ' nexperian Holding Limited ', U ' creation_date ': datetime.datetime (7, +, +, +), u ' emails ': [u ' D OmainAbuse@service.aliyun.com ', u ' YuMing@YinSiBaoHu.AliYun.com ']}>>>
Add: Python2 operation results are as follows:
The operating effect in Python3 environment is as follows: