I am using the OCRSpace API and I have never received this error message before. The OCR always has worked on this image but recently gave me IndexError: list index out of range
for: parse_results = result.get("Parsed Results")[0]
. The full code is:
url_api = "https://api.ocr.space/parse/image"
result = requests.post(url_api,
files = {os.path.join(path, file_name): file_bytes},
data = {"apikey": "KEY",
"language": "eng",
#"OCREngine": 2,
"isTable": True})
result = result.content.decode()
result = json.loads(result)
parsed_results = result.get("ParsedResults")[0]
global OCRText
OCRText = parsed_results.get("ParsedText")
Any help would be appriciated!