From 1638b887751b7765654e2741fbeebe79cc394e61 Mon Sep 17 00:00:00 2001 From: KaizIqbal <24286590+KaizIqbal@users.noreply.github.com> Date: Thu, 23 Jul 2020 08:37:59 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=82=20Out=20Directory=20overwrite?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index e21b4b2..e9d1b1d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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();