Answer the question
In order to leave comments, you need to log in
Post authorization in Python, how to get the required html?
Hello, I need to log in to the site https://userator.ru , and then parse data from the page https://userator.ru/cgi-bin/soft.cgi here is my code:
import requests
with requests.Session() as session:
url_login = 'https://userator.ru/cgi-bin/login_ajax.cgi'
params = {'Login':'****', 'Password':'****'}
session.get(url_login)
session.post(url_login, data=params)
url_next = 'https://userator.ru/cgi-bin/soft.cgi'
r = session.get(url_next)
print(r.text)
{"BeginPage":null,"hash":"*********************************************aky7XKl5E6ZGpXvfUMs84GAiYrbHpEfXxj1I72HzqaEViZlrwEtNscDBkd","dispname":"Алексей","temp_hash":null,"status":"gotoaccount","id":"393696"}
Answer the question
In order to leave comments, you need to log in
Log in to the site in the browser and click on the lock icon and see what is written in the cookies. You will be surprised, but there will be valuable information for you that must be sent in the headers on subsequent requests.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question