使用请求登录jsp网站

时间:2017-08-08 02:25:56

标签: python jsp python-requests

我有以下脚本:

import requests 
payload = {'j_username': 'user', 'password': 'pass'}
with requests.Session() as s:
    headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.109 Safari/537.36'}
    p = s.post('https://idp.mls.ntreis.net/idp/Authn/UserPassword', data=payload,headers=headers) 
    r = s.get('https://ssoportal.mls.ntreis.net/') 
    print(r.text) 

但是打印r.text在没有登录的情况下向我显示https://idp.mls.ntreis.net/idp/Authn/UserPassword的html来源

感谢您的帮助!

0 个答案:

没有答案