I can think of 2 approaches....
1) There is a package "KeyAndMouseInput" (or similarly named)... It allows sending keystrokes to other Windows. More exactly IIRC to the focused Windows
- You need the Browser to have focus. (At least the MS Windows has API has functions that may allow you to set that focus).
- It simulates keystrokes. If a user hits the keyboard, or clicks/focuses another Window... It breaks.
2)
https://www.selenium.dev/ But I have no idea if there is an Pascal interface to it.
There is an existing thread:
https://forum.lazarus.freepascal.org/index.php?topic=50082.0It lets you do quite some remote control of your browser.
And, if you just care about sending the result to the web server, IIRC there is a window-less browser that can load the page and do the work.