pywhois/parser.py
changeset 11 5083c26d8f93
parent 10 169462701583
equal deleted inserted replaced
10:169462701583 11:5083c26d8f93
   114             return WhoisFr(domain, text)
   114             return WhoisFr(domain, text)
   115         elif domain.endswith('.fi'):
   115         elif domain.endswith('.fi'):
   116         	return WhoisFi(domain, text)
   116         	return WhoisFi(domain, text)
   117         elif domain.endswith('.jp'):
   117         elif domain.endswith('.jp'):
   118             return WhoisJp(domain, text)
   118             return WhoisJp(domain, text)
       
   119         elif domain.endswith('.pl'):
       
   120             return WhoisPl(domain, text)
   119         else:
   121         else:
   120             return WhoisEntry(domain, text)
   122             return WhoisEntry(domain, text)
   121 
   123 
   122 
   124 
   123 
   125 
   269     def __init__(self, domain, text):
   271     def __init__(self, domain, text):
   270         if 'Not found:' in text:
   272         if 'Not found:' in text:
   271             raise PywhoisError(text)
   273             raise PywhoisError(text)
   272         else:
   274         else:
   273             WhoisEntry.__init__(self, domain, text, self.regex)
   275             WhoisEntry.__init__(self, domain, text, self.regex)
   274         
   276        
       
   277 
       
   278 class WhoisPl(WhoisEntry):
       
   279    """Whois parser for .uk domains
       
   280    """
       
   281    regex = {
       
   282        'domain_name':                    'DOMAIN NAME:\s*(.+)\n',
       
   283        'registrar':                      'REGISTRAR:\n\s*(.+)',
       
   284        'registrar_url':                  'URL:\s*(.+)',        # not available
       
   285        'status':                         'Registration status:\n\s*(.+)',  # not available
       
   286        'registrant_name':                'Registrant:\n\s*(.+)',   # not available
       
   287        'creation_date':                  'created:\s*(.+)\n',
       
   288        'expiration_date':                'renewal date:\s*(.+)',
       
   289        'updated_date':                   'last modified:\s*(.+)\n',
       
   290    }
       
   291    def __init__(self, domain, text):
       
   292        if 'Not found:' in text:
       
   293            raise PywhoisError(text)
       
   294        else:
       
   295            WhoisEntry.__init__(self, domain, text, self.regex)
       
   296  
   275     
   297     
   276 class WhoisMe(WhoisEntry):
   298 class WhoisMe(WhoisEntry):
   277     """Whois parser for .me domains
   299     """Whois parser for .me domains
   278     """
   300     """
   279     regex = {
   301     regex = {