S
S
SKEPTIC2019-06-10 12:10:33
Python
SKEPTIC, 2019-06-10 12:10:33

Simulating a button press on a website?

There is a site. The site has a form and a button that sends Ajax data to the server, and the server displays the information on the page.
How can I fill out this form in Python and click the button? After that, you need to collect information.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Sviridov, 2019-06-10
@pro100chel

Either make a POST request using the requests library (this will be the form submission, in fact), or screw Selenium.

V
Vitaly, 2019-06-11
@vitalysokolov

In such cases, I use the MechanicalSoup library, there is a browser.submit_selected() method.
With this soup, it is generally convenient to fill out forms, follow links
https://mechanicalsoup.readthedocs.io/en/stable/tu...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question