S
S
soremix2016-08-26 11:04:30
Python
soremix, 2016-08-26 11:04:30

How to log in using Python on a site with authorization through VK?

Good afternoon. I can not log in to mrandom.com (not advertising)
By pressing the "Login" button, mrandom.com/auth/vk opens (or mrandom.com/auth/vk/callback , I did not figure it out.)
ba812bf378f84617a51415619fd8d4d4.png
After entering the data, the form is sent and in Network can see it.
Request URL: https://login.vk.com/?act=login&soft=1
Request Method: POST
And this is from below:
84b97fcef9044c38926a51aa49fcc754.png
I took this code following the example from the Toaster, after parsing, you can understand that I am not authorized on the page.

import requests

s = requests.Session()
data = {"email":"[email protected]", "pass":"YYYYYYYYY"}
url = "http://mrandom.com/auth/vk"
r = s.post(url, data=data)

s.cookies

response = requests.get('http://mrandom.com/contests/my')
print('Result')
print(response.content)

Please help, I can't find the answer

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2016-08-26
@zmitrok62

There are ready-made libraries. Here is one of them: https://github.com/dzhioev/vk_api_auth

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question