⎗ ✓ 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 27 28 29 30 31 32const playwright = require('playwright'); let url = ``; let argv = proces.argv.slice(2); url = argv.shift(); if( /[(http(s)?):\/\/(www\.)?a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/.test(url) ) { console.log(`valid`); } (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); await page.getByPlaceholder('検索').click(); await page.getByPlaceholder('検索').fill('鳥インフルエンザ'); await page.getByPlaceholder('検索').press('Enter'); await page.waitForTimeout(1000); //screenshot var date = Date.now(); await page.screenshot({path: `${date}.png`}); await browser.close(); })();