Home > Back-end >  AttributeError: 'NoneType' object has no attribute 'strftime'AttributeError: �
AttributeError: 'NoneType' object has no attribute 'strftime'AttributeError: �

Time:07-17

I get an error for "AttributeError: 'NoneType' object has no attribute 'strftime'AttributeError: 'NoneType' object has no attribute 'strftime'". see full trace below:

ipython-input-96-a5697ab98b57> in <module>
----> 1 client.whois(domains)

/opt/conda/envs/rapids/lib/python3.8/site-packages/clx/osi/whois.py in whois(self, domains, arr2str)
     60                 resp_keys = resp.keys()
     61                 resp = self.__flatten_str_array(resp, resp_keys)
---> 62                 resp = self.__flatten_datetime_array(resp, resp_keys)
     63             result.append(resp)
     64         return result

/opt/conda/envs/rapids/lib/python3.8/site-packages/clx/osi/whois.py in __flatten_datetime_array(self, resp, resp_keys)
     79                     resp[key] = self.sep.join(values)
     80                 else:
---> 81                     resp[key] = resp[key].strftime(self.datetime_format)
     82         return resp

AttributeError: 'NoneType' object has no attribute 'strftime'

CodePudding user response:

#imports whois module and defines domains variable with pandas dataframe column dns.question.registered_domain

from clx.osi.whois import WhoIsLookupClient

domains = pdn_df["dns.question.registered_domain"]

client = WhoIsLookupClient()

client.whois(domains)


CodePudding user response:

The domains dataframe output:

domains.head()

j1417YEBMzlLJcALS71Z           firefox.com
tl417YEBMzlLJcALhb3-    cloudflare-dns.com
0l417YEBMzlLJcALpb1E      launchdarkly.com
3F417YEBMzlLJcALtL3q             pndsn.com
Name: dns.question.registered_domain, dtype: string
  • Related