import requests
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36'
}
url = 'http://10.23.10.20/Login.aspx'
data = {
'__EVENTTARGET':'',
'__EVENTARGUMENT':'',
'__LASTFOCUS':'',
'__VIEWSTATE': '/wEPDwUKLTU4MDcwODY1NA9kFgICAw9kFgoCBA8QDxYGHg1EYXRhVGV4dEZpZWxkBQdSZXNOYW1lHg5EYXRhVmFsdWVGaWVsZAUIUGFyYUNvZGUeC18hRGF0YUJvdW5kZ2QQFQMM566A5L2T5Lit5paHBuiLseaWhwznuYHkvZPkuK3mlocVAwVaSC1DTgVFTi1VUwVaSC1ISxQrAwNnZ2cWAWZkAgUPDxYCHgdWaXNpYmxlaGRkAgYPDxYCHwNoZGQCBw8PFgIeBFRleHQFEumqjOivgeeggeW3suemgeeUqGRkAgsPDxYEHghDc3NDbGFzcwUFc3ViYnQeBF8hU0ICAmRkZDv8A1G1UoCThtCFhAOH9WUJNdJM/dRKUFJVTapERgX8',
'__VIEWSTATEGENERATOR': 'C2EE9ABB',
'txtUserName': 'admin',
'txtPSW': '123456',
'HiddenField1':'',
'HiddenField2':'',
'UICultureDropDownList': 'ZH-CN',
'LoginButton':''
}
login_in = requests.post(url,headers=headers,data=data)
cookies = login_in.cookies
print(login_in)
print(cookies)
**得到的结果是:
Response [500]
RequestsCookieJar[]
请问这个是什么原因?**
****登入前:****
****登入后:****