added code example

This commit is contained in:
2023-12-14 17:04:31 +09:00
parent f290b18722
commit 843a90a0cd
9 changed files with 126 additions and 1 deletions

View File

@@ -0,0 +1,11 @@
const puppeteer = require('puppeteer');
const main = async () =>
puppeteer.launch({ headless: false })
.then(browser => browser.newPage()
.then(page => page.goto('https://www.youtube.com/')
.then(_response => page.screenshot({ path: "./ss.png" })
.then(_ => page.close()
.then(_ => browser.close())))));
main();