0

I want to ask is there a way so that, if the country or emails output from whois domain search is none it would print out none instead of an error?

This is the output that i got, from searching it manually. in which it doesn't have the same output as the others. for example from the previous whois search it has a different name then the current one that i searched. here is the comparison.

The previous whois search

and this is the current whois search output that i got.

The current one

As you can see, i think it's because of the different variables name like country and registrant_country or country and registrant_country it causes the output to go error.

emails error

This is the code that i use to input multiple domains to get multiple outputs that i want.

def whodata(host):
    res = whois.whois(host)
    print(res['registrar'])
    print(res['emails'])
    print(res['country'])
    print("---------")

Test = ["all of the domain wil be placed here"]

for host in test:
    whodata(host)

Is there a way i can improve upon it so that it can output the one that has no emails or country?

Thank you!

0 Answers0