D
D
Dmitry Eremeev2018-10-02 14:10:56
PHP
Dmitry Eremeev, 2018-10-02 14:10:56

How to automate the execution of user actions on the page (selecting an item-> clicking on a button)?

Hello! Essence of a question - there is a page with the report (on an inaccessible resource). It is necessary to display a set of reports on divisions for a day every day. The algorithm is as follows - select the department in the drop-down list, click generate, then the "export to Excel" button, in the standard browser window that appears, select where to save and save (or after clicking the button it is downloaded to the default download folder). I tried to automate via PHP + curl from a third-party service, but the problem is that the Export to Excel button, an ASP function is called from some library, but I can’t call it with curl. I was advised to use userscripts (for example, Tampermonkey or GreaseMonkey), but I can’t find how to simulate button presses and intercept the download of a file there. All the examples I found are either just an alert output, or a popup window. Is there any documentation, articles, books? Thanks for any hint.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavlo Zhak, 2018-10-02
@Littlewolf

as an option try to use selenium. You can run it both in normal mode when the browser window is launched, and in console mode (without a graphical interface, headless mode).

A
Anton Shamanov, 2018-10-02
@SilenceOfWinter

in Grismanki onClick is normal, about asp - in FF and Chrome there is a request monitor (FF tab network in the web development section) that allows you to get both addresses and page titles.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question