@
t6attack 感谢回复。我跟踪post请求,并构造了登录请求。请问为什么还是进入不了转存界面,prin页面t的结果还是有“输入提取密码”?
------------------------------------------------------------
# -*- coding: utf8 -*-
import urllib2
import urllib
#原网页
url = '
http://pan.baidu.com/s/1GrM2M'code = '1xpe'
#设置log
httpHandler = urllib2.HTTPHandler(debuglevel=1)
httpsHandler = urllib2.HTTPSHandler(debuglevel=1)
opener = urllib2.build_opener(httpHandler, httpsHandler)
urllib2.install_opener(opener)
#构造登录请求参数
postData1 = {
'pwd' : code,
'vcode' : '',
};
postData1 = urllib.urlencode(postData1);
#发送登录请求
loginRequest1 = urllib2.Request(url);
loginRequest1.add_header('Accept','*/*');
#loginRequest1.add_header('Accept-Encoding','gzip, deflate');
loginRequest1.add_header('Accept-Language','en-US,en;q=0.8,ja;q=0.6,zh-CN;q=0.4,zh-TW;q=0.2');
loginRequest1.add_header('Connection','keep-alive');
loginRequest1.add_header('User-Agent','Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36');
loginRequest1.add_header('Content-Type','application/x-www-form-urlencoded');
loginRequest1.add_header('X-Requested-With','XMLHttpRequest');
#网页读取
htm = urllib2.urlopen(loginRequest1)
print htm.read()