Closed baigreen closed 1 year ago
i actually have no errors in the lattest code,
you used the latest git code or the latest pip version ?
>>> import whois
>>> d = whois.query('edu.vlaanderen')
>>> print(d.__dict__)
{'name': 'edu.vlaanderen', 'tld': 'vlaanderen', 'registrar': 'Combell nv', 'registrant_country': 'BE', 'creation_date': datetime.datetime(2015, 2, 22, 9, 34, 48), 'expiration_date': datetime.datetime(2024, 2, 22, 9, 34, 48), 'last_updated': datetime.datetime(2023, 2, 22, 9, 35, 5), 'status': 'ok https://icann.org/epp#OK', 'statuses': ['autoRenewPeriod https://icann.org/epp#autoRenewPeriod', 'ok https://icann.org/epp#OK'], 'dnssec': False, 'name_servers': ['ns3.combell.net', 'ns4.combell.net'], 'registrant': 'Registrant State/Province:', 'emails': ['activation@combell.com']}
my error eth not edu ;-)
the issue is with the existing regex in .com that does not allow for a missing date and gobbles up the next line
fixed with
"creation_date": r"Creation Date:[ \t]*([^\n]*)",
"expiration_date": r"Registry Expiry Date:[ \t]*([^\n]*)",
"updated_date": r"Updated Date:[\t ]*([^\n]*)",
testing now
should be fixed in the current code now
./test2.py -d eth.vlaanderen
test domain: <<<<<<<<<< eth.vlaanderen >>>>>>>>>>>>>>>>>>>>
name str 'eth.vlaanderen'
tld str 'vlaanderen'
registrar str 'NETIM'
registrant_country str 'CN'
creation_date datetime.datetime 2023-03-08 17:06:28
expiration_date datetime.datetime 2024-03-08 17:06:28
last_updated NoneType None
status str 'ok https://icann.org/epp#OK'
statuses list ['addPeriod https://icann.org/epp#addPeriod', 'ok https://icann.org/epp#OK']
dnssec bool False
name_servers list ['ns1.dan.com', 'ns2.dan.com']
registrant str 'Registrant State/Province:'
emails list ['sales@netim.com']
Thank you ,sir
May add a try except for def "str_to_date" ?