From ded9fb2c2c03bfe206cc7f8b9397a0abb685763e Mon Sep 17 00:00:00 2001 From: Johan Denoyer Date: Mon, 12 Aug 2024 12:00:16 +0200 Subject: [PATCH] Update crawl_processor.py added code that handles tld registrars that do not support organisation info in whois data. --- datagather_modules/crawl_processor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/datagather_modules/crawl_processor.py b/datagather_modules/crawl_processor.py index 415f769..9caeb5a 100644 --- a/datagather_modules/crawl_processor.py +++ b/datagather_modules/crawl_processor.py @@ -21,6 +21,9 @@ def ip_gather(short_domain): def whois_gather(short_domain): try: w = whois.whois(short_domain) + # Handle tld registrars that do not support org data + if w.org is None: + w['org'] = 'n/a' return w except whois.parser.PywhoisError as e: print(Fore.RED + "Error while gathering WHOIS information. Reason: {}".format(e))