Python simple method for identifying website domain names and owners based on WHOIS module

Source: Internet
Author: User
Tags icann website domain names aliyun
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:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.