Attributeerror: 'Module' Object Has No Attribute 'Whois'

I tried to execute this code:

import whois
w = whois.whois('webscraping.com')
print w

And I got the error above. Why?

4

2 Answers

Wrong library, solution is to remove old one and install new :

pip uninstall whois 
pip install python-whois
1

Try this instead:

w = whois.query('webscraping.com')
3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Robert Thorne

Robert Thorne

Automotive & Future Transportation Editor

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.

Share this article
Twitter Facebook Pinterest