Answer the question
In order to leave comments, you need to log in
Python. Requests how to fix authorization problem?
I send a Post request with a username and password (and a couple more parameters), look at the result of the request, and there it says - "{"result":"0","error":"Your browser must support cookies."}"
Googled but did not find
Answer the question
In order to leave comments, you need to log in
Add the User-agent of one of the browsers to the header. It helped me. Very often, such a definition works stupidly according to which browser the user has.
sess = requests.Session()
headers = {"User-Agent":"Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:52.0) Gecko/20100101 Firefox/52.0"}
response = sess.post(url, ..., headers=headers)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question