app.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import json from domain_validation.whois import WHOIS def get_whois_info(domain): whois = WHOIS(domain) return { "domain":domain, "creation_date":str(whois.creation_date()), "registrar":whois.registrar() } domains = ["google.com","freemediatools.com","facebook.com","reddit.com"] whois_data = [get_whois_info(domain) for domain in domains] with open("result.json","w",encoding="utf-8") as f: json.dump(whois_data,f,indent=4,ensure_ascii=False) print("done") |