Python识别简单验证码(一)
2020-10-10 本文已影响0人
sunland_0416
素材准备下载
从网上找到一个简单的验证码的地址
# -*- coding:utf-8 -*-
import requests
import os
import time
os.makedirs('./image/', exist_ok=True)
IMAGE_URL = "xxxxxxxxxxxxxxxx"
for i in range(10,1000):
def request_download():
r = requests.get(IMAGE_URL)
with open('./image/'+str(i)+'.png', 'wb') as f:
f.write(r.content)
try:
request_download()
print('download img')
# im = Image.open('./image/img.png')
# im.show()
except:
print('download img error!')
time.sleep(1)