1
0
Fork 0
mirror of https://github.com/kou029w/_.git synced 2025-01-30 22:08:02 +00:00
This commit is contained in:
Nebel 2021-07-13 17:26:53 +09:00
parent 0e8d317255
commit a01bdb1391

View file

@ -7,17 +7,17 @@ async function main() {
const context = await browser.newContext(); const context = await browser.newContext();
const page = await context.newPage(); const page = await context.newPage();
await page.goto("about:blank"); 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 seq = i.toString().padStart(6, "0");
const title = await page.title(); const title = await page.title();
const date = new Date().toISOString().split("T")[0]; const date = new Date().toISOString().split("T")[0];
const path = `screenshot/${date}/${seq}-${title}.png`; const path = `screenshot/${date}/${seq}-${title}.png`;
await page.screenshot({ path }); await page.screenshot({ path });
await page.waitForTimeout(1_000); await page.waitForTimeout(1_000);
} catch {
// NOP
} }
} catch {
// NOP
} }
await page.close(); await page.close();
await context.close(); await context.close();