-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_transcriptWithID.py
More file actions
31 lines (26 loc) · 1011 Bytes
/
get_transcriptWithID.py
File metadata and controls
31 lines (26 loc) · 1011 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from collections import defaultdict
import requests
from bs4 import BeautifulSoup
stuId = input("请输入学号:")
headers = {
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
"Cache-Control": "max-age=0",
"Content-Type": "application/x-www-form-urlencoded",
"Origin": "null",
"Proxy-Connection": "keep-alive",
"Upgrade-Insecure-Requests": "1",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 Edg/115.0.1901.200"
}
url = "http://rpsjw.cdut.edu.cn/qzbb/reportJsp/showReport.jsp"
params = {
"rpx": "/148656-XSCJDXSD.rpx"
}
data = {
"selShowType": "all",
"kclx": "0",
"xsxh": stuId
}
response = requests.post(url, headers=headers, params=params, data=data, verify=False)
print(response.status_code)
print(response.text)