From a01bdb1391fc581adb95efe90b3532c4a971eca0 Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Tue, 13 Jul 2021 17:26:53 +0900 Subject: [PATCH] fix --- playwright-screenshot/main.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/playwright-screenshot/main.js b/playwright-screenshot/main.js index a08abc0..ed961ff 100644 --- a/playwright-screenshot/main.js +++ b/playwright-screenshot/main.js @@ -7,17 +7,17 @@ async function main() { const context = await browser.newContext(); const page = await context.newPage(); await page.goto("about:blank"); - try { - for (let i = 0 /* NOP */; ; i++) { + for (let i = 0 /* NOP */; ; i++) { + try { const seq = i.toString().padStart(6, "0"); const title = await page.title(); const date = new Date().toISOString().split("T")[0]; const path = `screenshot/${date}/${seq}-${title}.png`; await page.screenshot({ path }); await page.waitForTimeout(1_000); + } catch { + // NOP } - } catch { - // NOP } await page.close(); await context.close();