Header里的信息:
General
Remote Address:222.201.132.116:80
Request URL:http://222.201.132.116/(wa4qm345dj1m5i55qectnu22)/default2.aspx
Request Method:POST
Status Code:302 Found
Cache-Control:no-cache, no-store
Content-Length:173
Content-Type:text/html; charset=gb2312
Date:Sat, 18 Apr 2015 13:43:18 GMT
Expires:-1
Location:/(wa4qm345dj1m5i55qectnu22)/xs_main.aspx?xh=(这里是我的教务系统ID)
P3P:CP=CAO PSA OUR
Pragma:no-cache
Pragma:no-cache
Server:Microsoft-IIS/6.0
X-AspNet-Version:1.1.4322
X-Powered-By:ASP.NET
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8
Accept-Encoding:gzip, deflate
Accept-Language:zh-CN,zh;q=0.8
Cache-Control:max-age=0
Connection:keep-alive
Content-Length:198
Content-Type:application/x-www-form-urlencoded
Host:222.201.132.116
Origin:http://222.201.132.116
Referer:http://222.201.132.116/(wa4qm345dj1m5i55qectnu22)/default2.aspx
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2369.0 Safari/537.36
__VIEWSTATE:dDwyODE2NTM0OTg7Oz5VGnjXV87Z19Dm3QbgRgvcptEYyA==
txtUserName:(我的ID)
TextBox2:(我的密码)
txtSecretCode:xwcu
RadioButtonList1:(unable to decode value)
Button1:
lbLanguage:
hidPdrs:
hidsc:
主要是URL:http://222.201.132.116/(wa4qm345dj1m5i55qectnu22)/default2.aspx
这个URL中间是什么加密方法啊? = =
自己模拟登陆的代码:
import urllib
import urllib2
import cookielib
import re
class SCUT:
def __init__(self):
self.loginUrl = '这里是Login的URL'
self.cookies = cookielib.CookieJar()
self.postdata = urllib.urlencode({
'txtUserName:':'我的ID',
'TextBox2':'我的密码'
})
self.opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(self.cookies))
def getPage(self):
request = urllib2.Request(
url = self.loginUrl,
data = self.postdata)
result = self.opener.open(request)
#打印登录内容
print result.read().decode('gbk')
scut = SCUT()
scut.getPage()
有大神知道如何解决吗?
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.