Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Headless browser

Post Reply
АлександрМорозов
Posts: 3
Joined: Mon Jul 18, 2022 10:31 am

Headless browser

Post 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!
User avatar
salvadordf
Posts: 4079
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Headless browser

Post 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.
Post Reply