12 lines
398 B
JavaScript
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();
|