def parser(self, response):
if response:
match = re.findall(r'API limit', response.text) #
if match:
self.error_log.error_log('Sorry API Limit reached (300 q/month). Get new: https://totalhash.cymru.com/contact-us/',
self.station_name)
return []
xml_dict = xmltodict.parse(response.text)
if 'response' in xml_dict:
if 'result' in xml_dict['response']:
if 'doc' in xml_dict['response']['result']:
try:
response = xml_dict['response']['result'] # Unpacking xmltodict
for records in response['doc']:
self.hash_list.append(records['str']['#text']) # Append hash_values
except: pass
return self.hash_list # Return empty
评论列表
文章目录