Added funtion to build registrant details
This commit is contained in:
1 parent
1b77f05cad
commit
117ce36da5
1 file changed
+9
-1
+9
-1
@@ -3,6 +3,7 @@ import whois
|
||||
|
||||
class WhoIS():
|
||||
def __init__(self, domain):
|
||||
self.domain = domain
|
||||
self.getWhois(domain)
|
||||
|
||||
def getWhois(self, domain):
|
||||
@@ -10,5 +11,12 @@ class WhoIS():
|
||||
whoisData = whois.parser.Parser(domain, whoisData[1]).parse()
|
||||
self.registrar = whoisData.get('Registrar')
|
||||
self.status = whoisData.get('Status')
|
||||
self.registrant = whoisData.get('RegistrantName')
|
||||
self.registrant = self.buildRegistrantInfo(whoisData)
|
||||
self.nameservers = whoisData.get('NameServer')
|
||||
|
||||
def buildRegistrantInfo(self, whoisData):
|
||||
ret = {}
|
||||
ret['registrantName'] = whoisData.get('RegistrantName')
|
||||
ret['eligibilityType'] = whoisData.get('EligibilityType')
|
||||
ret['registrantID'] = whoisData.get('RegistrantID')
|
||||
return ret
|
||||
Reference in new issue
Block a user