python whois for windows

不打扰是莪最后的温柔 提交于 2019-12-02 04:24:41

On Windows just like on Linux, pywhois gives an error if the whois program is not installed. You could try this whois, for example.

The reason, of course, is in pywhois/init.py, line 11:

r = subprocess.Popen(['whois', domain], stdout=subprocess.PIPE)

Clearly this line needs to run some existing, installed whois command-line program (which accepts the domain to look up as a commandline argument), whatever OS it's running on.

You could use :

os.system("whois %s" % hostname)

Or use urllib to connect http://www.whois.net and scrap content.

Priest moon
import whois

site = input ("Enter Site : ")

n = whois.whois (site)

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