文章越来越水了,老样子,先上样本,这次是英文数字和算术混合,如图:
用以下字符集
['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '-', '×', '÷', '=', '?', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
通过判断是否存在算术特征,就可以有效区分算术和英数验证码了:
elif all_models.get(model_name).get('charset') == Charset.ARITHMETIC_ALPHA:
if '?' in predictions or '=' in predictions:
predictions = predictions.replace("×", "*").replace("÷", "/")
predictions = str(int(arithmetic.calc(predictions)))
测试页面:http://152.136.207.29:19812/preview?model_name=WX_RESERVATION