我有一个JSON文件,如下所示:
{"@count": 476, "@start": 1, "@totalcount": 476, "Messages": [],
"ResourceName": "Incident", "ReturnCode": 0, "content": [
{"Incident": {"IncidentID": "I08000003"}},
{"Incident": {"IncidentID": "I08000157"}},
{"Incident": {"IncidentID": "I08000274"}} }
当我尝试的时候
json_obj = json.load(response) for i in json_obj['content']:
我得到所有的行,但我只想得到数字(I08000003,I08000157…)
我该怎么办?你知道吗
您不仅需要解析输入,还需要收集
IncidentID
已解决:
谢谢大家的帮助
我建议你看看jsonpath。可能是用于这种数据提取的库:https://pypi.python.org/pypi/jsonpath-ng/1.4.2
这是下一代的联系。我相信它也有一个基本版本。你知道吗
相关问题 更多 >
编程相关推荐