From 063bea99789fd556a3ead2ffbde98ce638d61c25 Mon Sep 17 00:00:00 2001 From: lijingwei233 <531347509@qq.com> Date: Thu, 20 Feb 2020 22:48:43 +0800 Subject: [PATCH] again --- lib/crawler.py | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/lib/crawler.py b/lib/crawler.py index 302860f..0d71b4b 100644 --- a/lib/crawler.py +++ b/lib/crawler.py @@ -5,25 +5,6 @@ import base64 from bs4 import BeautifulSoup import random - -def addphonenumber(): - return ''' - - -

请输入手机号

-

教务新要求,需要绑定手机

-

如果不放心,可以登录教务查看

-

谢谢

- - - - - - -''' - - - def connection(username,password,phone): s = requests.Session() # 获取统一身份系统的网页 @@ -49,9 +30,7 @@ def connection(username,password,phone): '_eventId': 'submit', 'submit': '提交' } - print(execution) r = s.post(url="http://mysso-cust-edu-cn-s.webvpn.cust.edu.cn:8118/cas/login?service=https%3A%2F%2Fwebvpn.cust.edu.cn%2Fauth%2Fcas_validate%3Fentry_id%3D1",data=formdata) - print(r.text) r = s.get(url='http://portal-cust-edu-cn-s.webvpn.cust.edu.cn:8118/custp/index') soup=BeautifulSoup(r.text,'html.parser') try: @@ -68,7 +47,6 @@ def connection(username,password,phone): data = json.loads(r.content.decode('utf-8')) student_name = data['data']['StudentDto']['XM'] student_id = data['data']['StudentDto']['XH'] - print(student_name) return {'errcode': 200, 'errmsg': 'ok', 'ip': ip, 's': s,'student_name':student_name,'student_id':student_id} def getGrade(Ip, S):