📂 Out Directory overwrite

This commit is contained in:
KaizIqbal 2020-07-23 08:37:59 +05:30
parent 61deb9c49c
commit 1638b88775

View file

@ -10,9 +10,10 @@ import { bitmapsPath } from "./config";
headless: true,
});
const page = await browser.newPage();
await page.goto("https://google.com");
await page.goto("https://example.com");
if (!fs.existsSync(bitmapsPath)) fs.mkdirSync(bitmapsPath);
fs.mkdirSync(bitmapsPath);
await page.pdf({ path: path.resolve(bitmapsPath, "google.pdf") });
await browser.close();