在以下数据结构中:
[
{
"id": 28,
"country": "Brazil",
"country_code": "BR",
"country_population": 201103330,
"province": "",
"last_updated": "2020-04-03T01:40:00.724616Z",
"coordinates": {
"latitude": "-14.235",
"longitude": "-51.9253"
},
"latest": {
"confirmed": 8044,
"deaths": 324,
"recovered": 0
},
"timelines": {
"confirmed": {
"latest": 8044,
"timeline": {
"2020-01-22T00:00:00Z": 0,
"2020-01-23T00:00:00Z": 0,
"2020-01-24T00:00:00Z": 0,
}
},
"deaths": {
"latest": 324,
"timeline": {
"2020-01-22T00:00:00Z": 0,
"2020-01-23T00:00:00Z": 0,
"2020-01-24T00:00:00Z": 0,
}
},
"recovered": {
"latest": 0,
"timeline": {}
}
}
}
]
如何从"timelines"
键获取"timeline"
项
您的JSON确实存在问题
“JSONDecodeError:应使用双引号括起属性名:第24行第9列(字符558)”
这又是你的时间表,如上面所示
“时间线”:{ “2020-01-22T00:00:00Z”:0, “2020-01-23T00:00:00Z”:0,<; “2020-01-24T00:00:00Z”:0
JSON有很多格式问题,如果它们超出了一般规范,您可能需要开发自己的阅读方法,我已经做过几次了
您应该至少提供一段您目前尝试的代码
顺便说一下:
看起来很奇怪
timeline
应该是array
而不是object
吗相关问题 更多 >
编程相关推荐