I want to get "ocr_text" in this json
How can I get ocr_text
ex:json.loads(response.text)["name"]
{
"name": "jane doe",
"salary": 9000,
"skills": [{
"Raspberry pi":" MHSO",
"Machine Learning": "MHSO",
"Web Development": "uaskdj",
"ocr_text": "MH 02 CB 4545"
}],
"email": "[email protected]",
"projects": [
"Python Data Mining",
"Python Data Science"
]
}
2
Answers
Paste that into the python shell and experiment
There you go. That’ll get you the first ocr_text in the list. It will error if there are no items in the list. And it doesn’t deal with the likelyhood that there is more than one data item in that list.