I'm trying to extract a json. I'm having wrong extracted data for "error". When I try to do with t3 = temp['errors'][0]
I'm getting only "Arg one must not be null or empty."
Expected output:
"Arg one must not be null or empty.",
"Arg two must not be null or empty."
Here is my json:
{
"status": "Fail",
"warnings": {
"Code": "VALID",
"Desc": "Invalid data",
"errors": [
"Arg one must not be null or empty.",
"Arg two must not be null or empty."
]
}
}
Here is my code:
tmp = json.loads(res.content)
print(tmp['status'])
temp = (tmp['warnings'])
t1 = temp['errorCode']
t2 = temp['errorDesc']
t3 = temp['errors'][0]
print(t1)
print(t2)
print(t3)
Someone Please correct me what am I doing wrong?