Skip to content
This repository was archived by the owner on Apr 22, 2022. It is now read-only.

Commit db022a6

Browse files
committed
Update js files
TODO: proxy.py
1 parent d8a146a commit db022a6

File tree

9 files changed

+690
-485
lines changed

9 files changed

+690
-485
lines changed

check_code.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import numpy as np
33
from session import Session
44
import os
5+
import logging
56

67
from datetime import datetime
78

@@ -15,7 +16,7 @@ def __init__(self, sess: Session = Session()):
1516
try:
1617
self.check_code()
1718
except:
18-
print('验证码处理时出错')
19+
logging.error('验证码处理时出错')
1920

2021
def check_code(self, code=None, flag=True): # 是否传入验证码,是否第一次验证码错误
2122
"""
@@ -38,7 +39,7 @@ def check_code(self, code=None, flag=True): # 是否传入验证码,是否第
3839
# f.write(r.content)
3940
code = input('请输入验证码:')
4041
# code = self._distinguish(pic_path)
41-
print('验证码为:{0}'.format(code))
42+
logging.info('验证码为:{0}'.format(code))
4243
check_url = 'http://wenshu.court.gov.cn/Content/CheckVisitCode'
4344
headers = {
4445
'Host': 'wenshu.court.gov.cn',
@@ -51,13 +52,13 @@ def check_code(self, code=None, flag=True): # 是否传入验证码,是否第
5152
}
5253
req = self.sess.post(url=check_url, data=data, headers=headers)
5354
if req.text == '2':
54-
print('验证码错误')
55+
logging.error('验证码错误')
5556
if flag:
5657
self.check_code(code, False)
5758
else:
5859
self.check_code()
5960
else:
60-
print('验证码正确:{0}'.format(code))
61+
logging.info('验证码正确:{0}'.format(code))
6162

6263
# 两张图片的相似程度
6364
@staticmethod

error.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class NetworkException(Exception):
2+
3+
def __init__(self, value):
4+
self.value = value
5+
self.msg = 'Network Error'
6+
7+
def __str__(self):
8+
return self.value

js/backup/getKey.js

+22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)