teach-matsuuratomoya-com/content/docs/2023/mediaart-programming2/10/2_async_intro.js

12 lines
398 B
JavaScript

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();