初学Python的一些小分享,验证码识别
导读
项目地址:https://github.com/失眠l2h3/ddddocr
基本上常见的英数,都能验证成功,我上一个帖子是刷票工就娆实测验证码正确率在60%左右,勉强能接受吧
ddddocr测试页面:http://146.56.204.113:19199/preview
ddddocr,先在Python安装库就完事:
pip install ddddocr复制代码
我写的测试代码:
import requests
import ddddocr
url1="https://www.mynb8.com/index.php/user/verify/1659584255540"
url2="http://520.muruhui.org:8080/imgcode.php?num=0.6328522037529054"
url3='https://firefox.fun/ValidateCodePlus.aspx?Action=LOGIN6a42fcea3e7374351331cc4973a3894a1659584421000'
url4='http://api.8sim.top:8080/appc.php?webs=9750bfd88c6c02724e90d7356db20452'
image1=requests.get(url=url1)
image2=requests.get(url=url2)
image3=requests.get(url=url3)
image4=requests.get(url=url4)
ocr = ddddocr.DdddOcr()
res = ocr.classification(image1.content)
print(res)
res = ocr.classification(image2.content)
print(res)
res = ocr.classification(image3.content)
print(res)
res = ocr.classification(image4.content)
print(res)复制代码打开这四个网址,可以看到验证码的类型
上班去啦~