Created
December 20, 2023 18:17
-
-
Save johnlindquist/112a6106d606c95435e8694637cc7ecb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "@johnlindquist/kit" | |
import { chromium } from "playwright" | |
let browser = await chromium.launch({ | |
headless: false, // Set to true if you do not need to see the browser | |
}) | |
let page = await browser.newPage() | |
await page.setViewportSize({ width: 1920, height: 1080 }) | |
await page.goto("https://scriptkit.com") | |
// Wait for the network to be idle before taking the screenshot | |
await page.waitForLoadState("networkidle") | |
let screenshotPath = home(`scriptkit-${Date.now()}.png`) | |
await page.screenshot({ path: screenshotPath }) | |
await browser.close() | |
await revealFile(screenshotPath) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment