After making a request to an API I get an answer like the one shown below.
{
"mensaje": "success",
"respuesta": [
{
"tiempo": 594,
"total": 1543419350
},
{
"tiempo": 627,
"total": 1543425114
}
]
}
This is seen in its entirety using .content
print "Cuerpo de la respuesta:\n",response.content
And you can simply see 'answer' by
decoded = json.loads(response.content)
print decoded['respuesta']
Something like this remains:
[{u'tiempo': 594, u'total': 1543419350}, {u'tiempo': 627, u'total': 1543425114}]
But how can I do to save all the values of 'total' (in this case 2) in a list so I can work with them? In other words, how do I get there, without the rest?
Cheers!