调ShowapiRequest接口识别报如下错误,请老师帮忙看看什么原因
来源:2-15 showapiRequest解决图片验证码识别

慕婉清5162727
2019-06-13
老师,我的识别一直报如下错误,打印不出结果,麻烦帮看一下原因
C:\Users\Kerry_Amy\PycharmProjects\seleniumpython>python ./read_image.py
Traceback (most recent call last):
File “./read_image.py”, line 14, in
text=res.json()[‘showapi_res_body’][‘Result’]
KeyError: ‘Result’
代码
from ShowapiRequest import ShowapiRequest
#image=Image.open(“E:/imooc4.png”)
#text=pytesseract.image_to_string(image)
print(text)
r = ShowapiRequest(“http://route.showapi.com/184-4",“62626”,"d61950be50dc4dbd9969f741b8e730f5” )
#r.addBodyPara(“img_base64”, “”)
r.addBodyPara(“typeId”, “35”)
r.addBodyPara(“convert_to_jpg”, “0”)
r.addFilePara(“image”, r"E:/imooc11.png") #文件上传时设置
res = r.post()
text=res.json()[‘showapi_res_body’][‘Result’]
print(res.text)
3回答
-
慕UI7141847
2021-01-14
这个要怎么修改呢
012021-01-14 -
Mushishi
2019-06-13
text=res.json() 这里把text打印出来就行。
022019-06-13 -
Mushishi
2019-06-13
你先把你res打印出来看一下结果,就是不要后面的匹配
022019-06-14
相似问题