使用前提
- 准备python开发环境。(注:需要安装request库)
- 注册打码平台。(我这里使用的是云码,点击注册链接)
使用云码平台识别验证码的代码
#解析取到的图片验证码
def common_verify(image_base64):
imageDate = {
"image": image_base64,
"token": "(填写自己的密钥)",
"type": "10101"#(这块填写的是识别验证码的类型)
}
response = requests.post("https://www.jfbym.com/api/YmServer/verifyapi",headers =headers1,data=json.dumps(imageDate),proxies=proxies)
global imgyzm
imgyzm = response.json()['data']['data']
print(imgyzm)
注意:
- 这里传入的image_base64为图片的base64编码格式。
- 注意自己验证码的类型进行修改type。