Skip to content

Commit

Permalink
[TEST] puppeteer dynamic import
Browse files Browse the repository at this point in the history
  • Loading branch information
psychology50 committed Sep 18, 2023
1 parent 8e8c405 commit 7cf277d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions util/crawlKakaoLoginPage.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import puppeteer from "puppeteer";
import * as puppeteerCore from "puppeteer-core";

async function crawlKakaoLoginPage(finalUrl) {
let browser;
let page;
Expand All @@ -11,12 +8,14 @@ async function crawlKakaoLoginPage(finalUrl) {

console.log("[INFO] : start puppeteer");
if (osPlatform === 'darwin') {
const puppeteer = await import("puppeteer-core");
console.log("[INFO] : application runs on macOS")
browser = await puppeteerCore.launch({
headless: "new",
executablePath: process.env.CHROME_PATH,
});
} else if (/^win/i.test(osPlatform)) {
const puppeteer = await import("puppeteer");
console.log("[INFO] : application runs on Window")
browser = await puppeteer.launch({
headless: "new",
Expand Down

0 comments on commit 7cf277d

Please sign in to comment.