topic description
still cannot maintain a session session with session (),
sources of topics and their own ideas
url1 logs in with the account password. The url2 API also needs to be logged in, but this API returns data normally. Url3 also needs to log in, but it indicates that it is not logged in. The rookie asked a question for the first time. I"ve been stuck all day and ask the gods for help
related codes
import requests
S = requests.session ()
url =" http://m.xxxxx.com/user/login."
headers = {"User-Agent": header information}
data = {" username":"zhanghu",
"password":"654321",
"platform":"wap"}
r = S.post (url,data=data,headers=headers)
print (r.cookies)
print (r.text)
url2 =" http://m.xxxxx.com/v2/indexData"
data2 = {"pageIndex":"2", "pageSize":"6"}
url3 =" http://m.aaaa.cn/game/50007/play"
ChouJiang = S.post (url3,)
if you click url3, normally, you should give the information returned by the API to win a prize or there is no lottery number. Now it is prompted that you are not logged in.