32 lines
556 B
Python
32 lines
556 B
Python
import json
|
||
import requests
|
||
from urllib.parse import quote
|
||
import base64
|
||
from bs4 import BeautifulSoup
|
||
import random
|
||
import sys
|
||
|
||
# JSON转base64
|
||
def btoa(content):
|
||
return base64.b64encode(quote(content).encode())
|
||
|
||
s = requests.Session()
|
||
|
||
params = {
|
||
'Dto': {
|
||
'Code': "",
|
||
'LoginName': "2017002372",
|
||
'PassWord': "102710",
|
||
}
|
||
}
|
||
params = str(btoa(json.dumps(params)))[2:-1]
|
||
|
||
url = 'https://jwgl.cust.edu.cn/api/LoginApi/LocalLogin'
|
||
|
||
params = {
|
||
"__log":{"Logtype":1},
|
||
"param": params
|
||
}
|
||
|
||
r = s.post(url=url, data=params)
|
||
print(r.text) |