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

12 lines
398 B
JavaScript
Raw Permalink Normal View History

2023-12-14 08:04:31 +00:00
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();