Python whois for windows

I am trying to get whois in python. I use this http://code.google.com/p/pywhois/ but it only works on Linux. Can I run it on windows? I'm currently getting errors (since the linux whois internal command is used)

+1
python windows whois
source share
4 answers

On Windows, as on Linux, pywhois gives an error if whois not installed. For example, you can try this whois .

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

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

Obviously, this line needs to run some existing whois installed command-line program (which takes the domain to search as a command-line argument), regardless of which OS it is running on.

+5
source share

You can use:

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

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

+1
source share
 import whois site = input ("Enter Site : ") n = whois.whois (site) print (n) # whois python # or with CMD enjoy that 
0
source share

do not use python-whois, do not use whois. just recommend installing pythonwhois in pip

0
source share

All Articles