Skip to content

k.utils.puppeteer

Headless browser screenshot (non-online environment only)

Overview

k.utils.puppeteer Use Puppeteer to screenshot the URL and save it to a site file.

environment restrictions

Calling Kooboo Online Server (IsOnlineServer) will throw an exception and is only suitable for self-built/local environments.

screenshot()

ts
k.utils.puppeteer.screenshot("https://example.com", "shots/page.png", {
    width: 1366,
    height: 768,
    fullPage: true,
    delaySeconds: 3
})
ParameterTypeRequiredDescription
urlstringYesTarget URL
savePathstringYesSave path inside the site
optionsScreenshotOptionsNoScreenshot options

ScreenshotOptions

PropertyTypeDescription
delaySecondsnumberWait time in seconds, default 3
widthnumberViewport width, default 1366
heightnumberViewport height, default 768
fullPagebooleanWhether to capture the full page

Returns: void; the screenshot is written to savePath.