error when using pywhois

蹲街弑〆低调 提交于 2019-11-29 12:10:52
easy_install pywhois 

installs a different tool - it is a CLI tool - http://pypi.python.org/pypi/pywhois. To install the desired pywhois python lib, check it out from googlecode(hg clone https://code.google.com/p/pywhois/) or github (git clone https://github.com/unpluggd/pywhois.git)

and from the source dir run

python setup.py install
SparkAndShine

The project pywhois is moved to Bitbucket, here.

To install pywhois,

pip install python-whois

To use pywhois (import whois), here is an example.

import whois            
#check if a domain name is registered or not
try :
    w = whois.whois(url)
except (whois.parser.PywhoisError):  #NOT FOUND
    print(url)   #unregistered domain names, it is not very accurate.

A kind reminder that using pywhois is not very accurate. For more info, you can refer this question.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!