|
- import requests
- def get_data(url):
- login_data={
- 'username': '13952885713',
- 'password': 'A123456',
- 'saveLogin': 'true'
- }
- login_url='https://ljsxclb.lijingzy.com/login'
- res = requests.session() # session对象,保持链接
- response = res.post(login_url,data=login_data)
- accesstoken=response.json()['result']
- headers = {
- 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0',
- 'accesstoken': accesstoken
- }
- response = res.get(url, headers=headers)
- print(response.status_code)
- response.encoding = 'utf-8'
- for i in response.json()['result']['zyList']:
- print(i['dnzszymc'],i['jhzsrs'],i['xf'],i['xz'],i['lqzdf'],i['lqzdfwc'])
- url='https://ljsxclb.lijingzy.com/yuanxiaoLqxxJssdt/getYxByCmd?lqnf=2024&course=1&batch=2&yxzsdm=&yxId=965'
- get_data(url)
复制代码
用python挺简单 |
评分
-
1
查看全部评分
-
|