File tree Expand file tree Collapse file tree 2 files changed +37
-163
lines changed Expand file tree Collapse file tree 2 files changed +37
-163
lines changed Original file line number Diff line number Diff line change
1
+ #coding:utf-8
2
+ import requests
3
+ from pprint import pprint
4
+ info_login_url = "http://portal.ccnu.edu.cn/loginAction.do"
5
+ link_url = "http://portal.ccnu.edu.cn/roamingAction.do?appId=XK"
6
+ login_ticket_url = "http://122.204.187.6/xtgl/login_tickitLogin.html"
7
+ headers = {
8
+ "User-Agent" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" ,
9
+ }
10
+
11
+ post_data = {
12
+ 'userName' : 2016210942 ,
13
+ 'userPass' : 130395
14
+ }
15
+
16
+ _cookie_jar = None
17
+
18
+ s = requests .Session ()
19
+ r = s .post (info_login_url ,data = post_data )
20
+ if r .text .split ('"' )[1 ] == 'index_jg.jsp' :
21
+ r_second = s .get (link_url ,timeout = 4 )
22
+ r_third = s .get (login_ticket_url ,timeout = 4 )
23
+ ret = s .__dict__
24
+ cookies = ret ['cookies' ]
25
+
26
+
27
+ _cookie_jar = s .__dict__ .get ('_cookie_jar' )
28
+
29
+ pprint (s .__dict__ )
30
+ print ('\n \n \n \n ' )
31
+
32
+
33
+ print cookies .keys ()
34
+
35
+
36
+
37
+
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments