whoisit
whoisit copied to clipboard
IP Contact address field isn't parsed.
Hi,
IP Address contacts don't appear to be getting parsed. Looks like they aren't in the expected fields? Not sure if this is common to all IP records or just the 10 or so I've looked at.
eg; for 8.8.8.8 - https://rdap.arin.net/registry/entity/ABUSE5250-ARIN
import whoisit
>>> whoisit.version
'3.0.4'
>>> whoisit.bootstrap()
>>> r = whoisit.get('8.8.8.8')
>>> r.get('entities').get('abuse')[0].get('address')
{'po_box': '', 'ext_address': '', 'street_address': '', 'locality': '', 'region': '', 'postal_code': '', 'country': ''}
>>> raw = whoisit.get('8.8.8.8', raw=True)
>>> raw.get('entities')[0].get('entities')[0].get('roles')
['abuse']
>>> raw.get('entities')[0].get('entities')[0].get('vcardArray')[1][1]
['adr', {'label': '1600 Amphitheatre Parkway\nMountain View\nCA\n94043\nUnited States'}, 'text', ['', '', '', '', '', '', '']]
Might be able to check if the vcard it makes from the expected field is empty and then try to parse the entry_data field like so.
splits = entry_data.get('label').split('\n')
v_card_array_data_dict['address'] = VCardArrayAddressDataDict(
po_box=clean_address(entry_label[-7]),
ext_address=clean_address(entry_label[-6]),
street_address=clean_address(entry_label[-5]),
locality=clean_address(entry_label[-4]),
region=clean_address(entry_label[-3]),
postal_code=clean_address(entry_label[-2]),
country=clean_address(entry_label[-1])
)
Could be a bit dodgy as \n separated data might vary?