Skip to content

Commit cdacd17

Browse files
committed
Initial commit
0 parents  commit cdacd17

File tree

8 files changed

+180
-0
lines changed

8 files changed

+180
-0
lines changed

.idea/CETScoreQuery.iml

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 71 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License
2+
3+
Copyright (c) 2010-2017 Google, Inc. http://angularjs.org
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## 四六级免准考证成绩查询 ##
2+
### 使用 ###
3+
```
4+
main.exe argv1 argv2 argv3
5+
```
6+
argv1: 姓名
7+
8+
argv2:身份证
9+
10+
argv3:四级为“4”,六级为“6”
11+

main.exe

20.2 MB
Binary file not shown.

main.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# -*- coding: UTF-8 -*-
2+
# Author: firejq
3+
# Created on 2017/8/23
4+
import requests
5+
import json
6+
import sys
7+
from bs4 import BeautifulSoup
8+
9+
10+
def query(name, id_card, jb):
11+
zkz_url = 'http://app.cet.edu.cn:7066/baas/app/setuser.do?method=UserVerify'
12+
zkz_postdata = {
13+
'action': '',
14+
'params': json.dumps({
15+
"ks_xm": name,
16+
"ks_sfz": id_card,
17+
"jb": jb
18+
})
19+
}
20+
zkz_query = requests.post(url=zkz_url, data=zkz_postdata)
21+
zkz = json.loads(zkz_query.content)['ks_bh']
22+
23+
score_url = 'http://www.chsi.com.cn/cet/query'
24+
score_getdata = {
25+
'zkzh': zkz,
26+
'xm': name
27+
}
28+
score_query_headers = {
29+
'Referer': 'http://www.chsi.com.cn/cet/',
30+
'Cookie': 'JSESSIONID=585FDCDE6A256DF086B6320056528E38; aliyungf_tc=AQAAAODGXH0+uwMA/SHfDvzrwCJnctoY; acw_tc=AQAAAHkk0kv4ygMA/SHfDt/AnSyLDeqq'
31+
}
32+
score_query = requests.get(
33+
url=score_url,
34+
params=score_getdata,
35+
headers=score_query_headers)
36+
37+
bs = BeautifulSoup(score_query.text, 'lxml')
38+
score = bs.select('.colorRed')[0]
39+
print('准考证号:' + zkz)
40+
print('姓名:' + name)
41+
print('成绩:' + score.text.strip())
42+
43+
44+
name = sys.argv[1]
45+
id_card = sys.argv[2]
46+
if sys.argv[3] == '4':
47+
jb = 1
48+
elif sys.argv[3] == '6':
49+
jb = 2
50+
query(name, id_card, jb)

0 commit comments

Comments
 (0)