调用ShowapiRequest报错,调用不了,请老师指导以下

来源:2-15 showapiRequest解决图片验证码识别

慕粉4484258

2020-08-05

from liliwei import ShowapiRequest
from PIL import Image
import pytesseract

image = Image.open(“E:/imooc1.png”)

text = pytesseract.image_to_string(image)

print(text)

r = ShowapiRequest(“http://route.showapi.com/2360-1",“314848”,"f1e789c973e546d4ae6da6071e339aaa” )
r.addBodyPara(“typeId”, “35”)
r.addBodyPara(“convert_to_jpg”, “0”)
r.addFilePara(“image”, r"E:/imooc1.png") #文件上传时设置
res = r.post()
text = res.json()[‘showapi_res_body’][‘Result’]
print(text) # 返回信息

报以下错误:
D:\untitled\venv\Scripts\python.exe D:/untitled/liliwei/read_image.py
Traceback (most recent call last):
File “D:/untitled/liliwei/read_image.py”, line 9, in
r = ShowapiRequest(“http://route.showapi.com/2360-1",“314848”,"f1e789c973e546d4ae6da6071e339aaa” )
TypeError: ‘module’ object is not callable

Process finished with exit code 1

写回答

1回答

Mushishi

2020-08-05

哈哈,看sdk模版,但是建议更换成阿里的云识别

0
2
Mushishi
回复
慕粉4484258
这个不是已经告诉你了么?你应该是request这里吧你的请求数据加进去。你可以看一下他应该有一个request的请求数据。
2020-08-10
共2条回复

Selenium3与Python3实战Web自动化测试框架

打破无项目经验、无框架经验瓶颈,实战Web自动化测试框架!

1883 学习 · 1093 问题

查看课程