J
J
Jairman2020-06-13 20:39:17
Python
Jairman, 2020-06-13 20:39:17

How to send requests the same as the site does when the button is clicked?

How to form these requests in general?
(On the screenshot for an example, a button from the site and its data from the Network tab)
5ee50e4aa076c202769547.png5ee50e53d4f31255468916.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Karbivnichy, 2020-06-13
@hottabxp

See the headers, cookies and parameters that the browser sends and copy all this into your script. But it's not all that simple. Some data may be generated on previous pages. You also need to pay attention to the parameters "many_letters_and_numbers" - you need to understand what it is and where it comes from. Perhaps js generates such data based on some data.
In general, doing this on requests is nonsense. For such sites it is better to use Selenium.

D
Dr. Bacon, 2020-06-13
@bacon

So further explore in the "developer tools" of the browser, there is a lot of detailed information.

T
Timur Pokrovsky, 2020-06-13
@Makaroshka007

https://stackoverflow.com/questions/27869225/pytho...
https://www.reddit.com/r/learnpython/comments/6bt8...
google has it all

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question