E
E
Eltorniado2022-01-04 14:45:33
Python
Eltorniado, 2022-01-04 14:45:33

Regarding post requests of the requests library. There is a problem. How to decide?

There is a page where you need to receive a call to your phone - https://passport.yandex.ru/registration

s = requests.Session()
response = s.post("https://passport.yandex.ru/registration", data = data, headers = headers)

When I studied the structure of the authorization fields, I noticed that there is practically no js mixed in anywhere, so you can fill in the fields without resorting to slow selenium, simply by passing the data parameter in the request, which will set the values ​​of the name attributes in the fields.
data = {
    "password" : "juH/KJ7y$t87",
    "password_confirm" : "juH/KJ7y$t87",
    "phone" : "9543211234"
  }
#имя, фамилию и логин для получения подтверждающего звонка заполнять не обязательно
#достаточно лишь пароля и его подтверждения с номером телефона, куда поступит звонок

The problem is that the post request clicks on the wrong button, it clicks on "I don't have a phone", which results in something completely wrong. In place of having to click on "Verify number", and get a call. The question is how to do everything in a normal way so that the right button is pressed? Or is it not possible to do this with requests? Inevitably have to use slow selenium because of such a petty issue?

(if you fill in manually, write the number and press enter, everything will work fine and a call will come in)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question