Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mkdir screenshot
- cd screenshot
- npm i puppeteer --save
- ######SCRIPT######
- const puppeteer = require('puppeteer');
- const url = process.argv[2];
- if (!url) {
- throw "Please provide URL as a first argument";
- }
- async function run () {
- const browser = await puppeteer.launch({headless: 'new'});
- const page = await browser.newPage();
- await page.goto(url);
- await page.screenshot({path: 'screenshot.png'});
- browser.close();
- }
- run();
- ########RUN#########
- node screenshot.js "https://filmsbykris.com"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement