3 ms·
Couple of options: You can build a small JavaScript package with a HTTP server to call your endpoint and puppeteer for actually running and interfacing with Chr
by heipei 6y ago
Couple of options: You can build a small JavaScript package with a HTTP server to call your endpoint and puppeteer for actually running and interfacing with Chrome headless and then either Dockerize it or even run it as a Lambda / Google Cloud Function. Then there's https://github.com/browserless/chrome/ https://github.com/browserless/chrome/ which is both a commercial service as well as being Open Source. Plenty of other OSS and commercial options as well, ultimately it comes down to your use-case. Personally I've found reliably taking a screenshot at the right point in time challenging since a page is never really "done" loading, i.e. there could always be a refresh or timeout which loads another URLs, adds an iframe or changes something else entirely, so there is no single "yes, we're done loading now" event to wait for. Source: I run the service at https://urlscan.io https://urlscan.io where we have the same problem ;)