Answer the question
In order to leave comments, you need to log in
POST request in request python module?
Programmatically send a POST request
import requests
url = "https://login.1c.ru/login?service=https%3A%2F%2Freleases.1c.ru%2Fpublic%2Fsecurity_check"
data = {'username':'Test','password':'Test2'}
print(requests.post(url, data = data).text)
input id="password" name="password" class="required span12 form-control" tabindex="2" value="Test2" type="password" value=""
input id="username" name="username" class="required span12 form-control" tabindex="1" spellcheck="false" type="text" value="
Answer the question
In order to leave comments, you need to log in
Go to the site in a browser, open the request manager (network tab for ff),
enter your username and password, click the button. Now you need to find the request that went to the server. Watch and analyze all its headers, parameters. You need to programmatically make exactly the same request. Moreover, if some data is not static, but is generated during / before the request is executed, you need to do the same. For example, in a request, in addition to the login / password, there may be a current time. And in order for the script to work, you must also send this time to the server.
What you are sending now will not be sent in this form by any browser.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question