S
S
Stuksus2018-07-25 19:43:34
Python
Stuksus, 2018-07-25 19:43:34

How to authorize on the mos.ru website using requests?

Good afternoon, there is a desire to write a script for authorization on mos.ru, but there were problems with the implementation.
Here is the code:

import requests
def test():
    session = requests.Session()
    url ='https://oauth20.mos.ru/sps/j_security_check'
    data ={'j_username':'ТЕЛЕФОН', 'j_password':'ПАРОЛЬ','accessType':'phone'}
    print(requests.post(url,data=data).text)

After running the program returns the following:
5b58a7ccbc796674481660.jpeg
Please tell me how to solve this problem

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
Tim, 2018-07-27
@Stuksus

print(requests.post(url, json =data).text)

M
Marat Nagayev, 2018-07-25
@nagayev

Since they write that an error in the url can really be mistyped?
Check spelling.
If it does not work out, I recommend opening the fox / chrome console and looking on the network to see how the authorization is going.
I recommend paying attention to the cookie tab, a lot also depends on it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question