import requests,json
url=‘json地址’
result=requests.get(url,)
content=result.text
dict = json.loads(content)
list_key = []
j = 0
for key in dict[‘data’]:
list_key.append(key)
for i in list_key:
print(’----’+list_key[j]+’----’)
for key in dict[‘data’][list_key[j]]:
print(key,dict[‘data’][list_key[j]][key])
j += 1
for key in json_dict[‘data’]:
print(key,json_dict[‘data’][key])
python处理json数据(复杂的json转化成嵌套字典并处理)
最新推荐文章于 2024-07-22 10:23:04 发布