--- a/whois/parser.py Fri Feb 03 16:17:46 2017 +0800
+++ b/whois/parser.py Fri Apr 14 23:19:44 2017 +0800
@@ -251,6 +251,8 @@
return WhoisSe(domain, text)
elif domain.endswith('.is'):
return WhoisIs(domain, text)
+ elif domain.endswith('.dk'):
+ return WhoisDk(domain, text)
else:
return WhoisEntry(domain, text)
@@ -1182,3 +1184,21 @@
raise PywhoisError(text)
else:
WhoisEntry.__init__(self, domain, text, self.regex)
+
+class WhoisDk(WhoisEntry):
+ """Whois parser for .dk domains
+ """
+ regex = {
+ 'domain_name': 'Domain: *(.+)',
+ 'creation_date': 'Registered: *(.+)',
+ 'expiration_date': 'Expires: *(.+)',
+ 'dnssec': 'Dnssec: *(.+)',
+ 'status': 'Status: *(.+)',
+ 'name_servers' 'Nameservers\n *([\n\S\s]+)'
+ }
+
+ def __init__(self, domain, text):
+ if 'No match for ' in text:
+ raise PywhoisError(text)
+ else:
+ WhoisEntry.__init__(self, domain, text, self.regex)