10 lines
384 B
JavaScript
10 lines
384 B
JavaScript
|
|
const { chromium } = require('playwright');
|
||
|
|
const { pathToFileURL } = require('url');
|
||
|
|
(async () => {
|
||
|
|
const b = await chromium.launch({headless:true});
|
||
|
|
const p = await b.newPage({viewport:{width:1240,height:900}});
|
||
|
|
await p.goto(pathToFileURL(process.argv[2]).href, {waitUntil:'networkidle'});
|
||
|
|
await p.screenshot({path:process.argv[3], fullPage:true});
|
||
|
|
await b.close();
|
||
|
|
})();
|