B
B
Bug2020-10-11 23:18:11
Python
Bug, 2020-10-11 23:18:11

How to login to website using python?

how to log in to vk through requests ?

url = 'https://vk.com/'
login = '******'
password = '*******'
s = requests.Session()
r = s.get(url, auth=(login, password))
print(r.text)


but the authorization page itself comes to me, i.e. ( https://vk.com/ ), but according to the idea it should ( https://vk.com/feed )

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
shurshur, 2020-10-11
@thema__python3

So vk does not support HTTP Auth, what's the point of passing such parameters? Of course, the main page of the site will be returned.
You can see how authorization is arranged in the same vk_api

D
Developer, 2020-10-11
@samodum

have you heard about cookies? your headers are not even filled

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question