不说了,直接上代码
import json
import requests
import datetime
url = '
https://view.inews.qq.com/g2/getOnsInfo?name=wuwei_ww_area_counts&callback'res = requests.get(url).json()['data']
data = json.loads(res)
list_data = []
for item in data:
if item['country'] == '中国':
list_data.append(str(item['country']) + str(item['area'])+str(item['city']) + "确诊:" + str(item['confirm']) + "例,疑似:" + str(item['suspect'])+ "例,死亡:"+str(item['dead']) + "例,治愈:"+str(item['heal'])+"例;")
print (str(datetime.datetime.now()) + "\n")
for item in sorted(list_data):
print (item)
--
FROM 111.182.30.*