This is my output.json file:
{
"ParsedResults": [
{
"TextOverlay": {
"Lines": [],
"HasOverlay": false,
"Message": "Text overlay is not provided as it is not requested"
},
"TextOrientation": "0",
"FileParseExitCode": 1,
"ParsedText": "180 Grade IV\r\n\u0103\u021ar: Class VIII Pass\r\nwww.facebook.com, Since 2012\r\n",
"ErrorMessage": "",
"ErrorDetails": ""
}
],
"OCRExitCode": 1,
"IsErroredOnProcessing": false,
"ProcessingTimeInMilliseconds": "343",
"SearchablePDFURL": "Searchable PDF not generated as it was not requested."
}
I am trying to get the ParsedText value from this JSON file.
This is my the code I am using:
import json
f = open('output.json',)
data = json.load(f)
print(data['ParsedResults']['TextOverlay']['ParsedText'])
f.close()
Facing this error:
TypeError: list indices must be integers or slices, not str
How to read that particular value from ParsedText, please guide. Thanks in Advance