


Python's method to simply identify website domain name and owner based on whois module
This article mainly introduces Python's method of simply identifying website domain names and owners based on the whois module, and briefly analyzes the installation and use of Python whois module related operating techniques. Friends in need can refer to this article
The example describes how Python can simply identify the website domain name and owner based on the whois module. Share it with everyone for your reference, the details are as follows:
For some websites, we may care who their owners are. In order to find the owner of the website, we can use the WHOIS protocol to query who the registrant of the domain name is. There is a wrapper library for this protocol in Python. We can install it through pip.
pip install python-whois
Supplement: This machine has two versions of Python2 and Python3 installed. Here, pip2 is used to install the python-whois
module, as follows As shown in the picture:
The native Python3 environment is suitable for pip3 installation python-whois The module is shown in the following picture:
Import moduleimport whois
>>> import whois >>> whois.whois('https://www.cgtz.com/') {u'updated_date': datetime.datetime(2018, 3, 26, 7, 37, 52), u'status': [u'clientTransferProhibited 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, 12, 18, 24, 22), 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(2008, 7, 12, 18, 24, 22), u'emails': [u'DomainAbuse@service.aliyun.com', u'YuMing@YinSiBaoHu.AliYun.com']} >>>
Supplement: The screenshot of the Python2 running result is as follows:
The running effect in Python3 environment is as follows:
Related recommendations:
php whois query API production method
whois PHP implements domain name whois query code data source Wanwang, Xinwang
##
The above is the detailed content of Python's method to simply identify website domain name and owner based on whois module. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Regarding the problem of removing the Python interpreter that comes with Linux systems, many Linux distributions will preinstall the Python interpreter when installed, and it does not use the package manager...

Pylance type detection problem solution when using custom decorator In Python programming, decorator is a powerful tool that can be used to add rows...

About Pythonasyncio...

Using python in Linux terminal...

Loading pickle file in Python 3.6 environment error: ModuleNotFoundError:Nomodulenamed...

Compatibility issues between Python asynchronous libraries In Python, asynchronous programming has become the process of high concurrency and I/O...

Error loading Pickle file in Python 3.6 environment: ModuleNotFoundError:Nomodulenamed...

The problem and solution of the child process continuing to run when using signals to kill the parent process. In Python programming, after killing the parent process through signals, the child process still...
