Page 1 of 1

Headless browser

Posted: Mon Jul 18, 2022 10:43 am
by АлександрМорозов
sorry - it's google)
I'm new here and this is the first time I've seen the component. I have a question - do you know if it is possible to make a console program that opens pages using JS and could give the result of this work, for example, as an answer to my query xpath.... The main task - to minimize the tail of dynamic libraries because I don't need to draw anything, like make a graphical menu...
Maybe someone has a prototype, preferably for FPC, because I need the result for Win64 and Mac.....
Help a beginner!

Re: Headless browser

Posted: Mon Jul 18, 2022 7:49 pm
by salvadordf
Hi,

Try the ConsoleBrowser2 and WebpageSnapshot demos. They use a CEF browser in off-screen rendering mode in a thread to get a screenshot.

In order to reduce the size of the CEF binaries you can delete cef_sandbox.lib, libcef.lib and some translations but nothing else.

All the demos for macOS use a graphical interface and I don't know how to create a console app for that OS. Perhaps it's also possible to create a version of ConsoleBrowser2 for macOS but I have a very limited experience with that operating system.