Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# -
一个普通的验证码识别程序
# 一个普通的验证码识别程序

环境:python3

依赖:pillow,requests
依赖:pillow, requests

使用:
首先应该修改python_getpic.py文件中相关的路径名(下载验证码存放路径),因为本人用的是自己电脑的路径。
## 使用:

运行然运行python_recognize.py
首先应该修改 python_getpic.py 文件中相关的路径名(下载验证码存放路径),因为本人用的是自己电脑的路径。

十分简单,150行代码配合注释应该也不算难理解
运行 python_getpic.py 一次,然后运行 python_recognize.py

十分简单,150 行代码配合注释应该也不算难理解

我的识别结果正确率大概在97%左右。
4 changes: 2 additions & 2 deletions python_getpic.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#coding=utf-8
import requests
import os

Expand All @@ -11,10 +12,9 @@

os.makedirs(path)
for i in range(0,num):
print("下载第"+str(i)+"张验证码")
print("下载第 "+str(i)+" 张验证码")
filePath=path+str(i)+'.jpg'
#这个地址下可以下载到普通的验证码
r=requests.get('http://jw.hrbeu.edu.cn/ACTIONVALIDATERANDOMPICTURE.APPPROCESS')
with open(filePath,'bw') as f:
f.write(r.content)

1 change: 1 addition & 0 deletions python_recognize.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#coding=utf-8
from PIL import Image
import traceback
import python_getpic
Expand Down