Python 网页抓取、Url跳转阻止授权?

Python 网页抓取、Url跳转阻止授权?,python,html,web-scraping,python-requests,Python,Html,Web Scraping,Python Requests,我一直在努力清理这个网站(www.dearedu.com),特别是,我在登录时遇到了巨大的困难……我尝试了所有我能找到的关于stack exchange上先前回答的授权问题的方法 目前,我正在使用请求会话使用以下代码登录 cj = cookielib.CookieJar() mySession = requests.session() mySession.headers.update({'User-Agent':'Mozilla/5.0 (Macintosh; Inte

我一直在努力清理这个网站(www.dearedu.com),特别是,我在登录时遇到了巨大的困难……我尝试了所有我能找到的关于stack exchange上先前回答的授权问题的方法

目前,我正在使用请求会话使用以下代码登录

    cj = cookielib.CookieJar()

    mySession = requests.session()
    mySession.headers.update({'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36'})


    data = mySession.get('http://www.dearedu.com/', cookies = cj)


    data= {'userid': myusername, 'pwd': mypassword,
    'fmdo': 'login', 'dopost': 'login',
    'keeptime': '604800', 'teshu': 't'}

    data = mySession.post('http://club.dearedu.com/member/index_do.php', data=data)
当上面的代码使用正确的密码和用户名运行时,您将得到以下html

<head>
<title>第二教育网提示信息</title> 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<base target='_self'/>
<style>div{line-height:160%;}</style></head>
<body leftmargin='0' topmargin='0' bgcolor='#FFFFFF'>
<center>
<script>
      var pgo=0;
      function JumpUrl(){
        if(pgo==0){ location='http://www.dearedu.com'; pgo=1; }
      }
document.write("<br /><div style='width:450px;padding:0px;border:1px 
solid #DADADA;'><div style='padding:6px;font-size:12px;border-
bottom:1px solid #DADADA;background:#DBEEBD 
url(/plus/img/wbg.gif)';'><b>第二教育网提示信息!</b></div>");
document.write("<div style='height:130px;font-
size:10pt;background:#ffffff'><br />");
document.write("成功登录,现在转向系统主页...");
document.write("<br /><a href='http://www.dearedu.com'>如果你的浏览器没
反应,请点击这里...</a><br/></div>");
setTimeout('JumpUrl()',1000);</script>
</center>
</body>
</html>

第二教育网提示信息 
div{行高:160%;}
var-pgo=0;
函数JumpUrl(){
如果(pgo==0){location==0http://www.dearedu.com';pgo=1;}
}
文档。写入(“