本人小新手,准备接入91验证码答题的接口,写接入代码后提示 错误提示int类型没有下标 ,求助解决方案,是哪里出错了。
代码如下:
codeType = 8020
remark = ""
timeout = 60
sendCaptchaRet = _91yanzhengmaObj.SendFile(pwd_str, captchaPicFile, codeType, timeout, 1, remark)
if (sendCaptchaRet[0] == '#'):
logging.info("send_captcha_91yanzhengma ERROR Exit with (False, %s)" %(sendCaptchaRet))
return (False, "")
运行后提示:
Traceback (most recent call last):
File "<string>", line 101, in <module>
File "<string>", line 58, in testMain
File "<string>", line 67, in captchaBreak
File "D:\Workspace\projects\license\script\python_proj\bid_scrit\bid_script_16
05_A\build\test_dati\out00-PYZ.pyz\decaptcha", line 1421, in decaptcha_remote_ma
nual
File "D:\Workspace\projects\license\script\python_proj\bid_scrit\bid_script_16
05_A\build\test_dati\out00-PYZ.pyz\decaptcha", line 993, in send_captcha_91yanzh
engma
TypeError: 'int' object is unsubscriptable
91验证码答题SendFile函数源代码:
const char * WINAPI SendFile(const char * pwd_str,const char * path,int type,int timeout,int custom_price,const char *remark);
/* 说明: 上传验证码图片得到题号,如果返回值首字母为#则代表出错,重新调用即可,可循环调用多次直到调用成功
参数列表:
const char * pwd_str 用户答题串
const char * path 本地图片路径
int type 题目类型http://www.91yzm.com/help/price.php
int timeout 超时时间(单位秒)
int custom_price 默认传1
const char *remark 题目要求备注(例如:字母要区分大小写)
返回值:
成功:返回题号 (温馨提示:开发者只需判断返回值首字母是否为#即可,不为#则成功)
失败:返回#开头错误ID。错误代码详见:http://www.91yzm.com/help/allErrorCode.php*/