⎗ ✓ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26/** * node.js から playwright での chrome ブラウザ操作テスト **/ const playwright = require('playwright'); const url = "https://www.youtube.com/"; (async () => { const browser = await playwright.chromium.launch({ channel: 'chrome',headless : false, }); //context const context = await browser.newContext(); //page const page = await context.newPage(); //navigate await page.goto(url); var date = Date.now(); //screenshot await page.screenshot({path: `${date}.png`}); await browser.close(); })();