def checkcode(): img = s.get(codeurl, stream=True, headers=headers) with open('checkcode.gif', 'wb') as f: f.write(img.content) code = recognizer.recognize_checkcode('/home/fty/new-system/checkcode.gif') # print(code) return code
def checkcode(): img=s.get(codeurl, stream=True, headers=headers) with open('checkcode.gif','wb') as f: f.write(img.content) trainner.update_model() code = recognizer.recognize_checkcode('checkcode.gif') #print(code) return code
def get_captcha(): image = r.get(aspx_url, headers=header) with open('CheakCode.png', 'wb') as f: f.write(image.content) image = Image.open("CheakCode.png") image.show() code = recognizer.recognize_checkcode('CheakCode.png') print(code) checkcode = input("请输入验证码") return checkcode
def identify(): code = recognizer.recognize_checkcode('./checkcode.png') print(code)