如果我有带有重复键的JSON,每个重复键中的值都不同,如何在Python中提取两个值?
例如:
如果我想获取两个时间戳,我该怎么做?
我尝试过
{
'posting': {
'content': 'stuff',
'timestamp': '123456789'
}
'posting': {
'content': 'weird stuff',
'timestamp': '93828492'
}
}
如果我想获取两个时间戳,我该怎么做?
我尝试过
a = json.loads(json_str)
然后使用 a['posting']['timestamp']
,但这只返回一个值。