diff --git a/index.js b/index.js index 5762c92..e0ce550 100644 --- a/index.js +++ b/index.js @@ -9,7 +9,9 @@ import AdblockerPlugin from 'puppeteer-extra-plugin-adblocker'; import fs from 'fs'; const url = 'https://www.bestbuy.com/gateway/graphql'; +// toggle browser for platform. const browser_path = 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe'; +//const browser_path = '/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome'; puppeteer.use(StealthPlugin()); puppeteer.use(AnonymizeUAPlugin()); diff --git a/login.js b/login.js index 8eaa75b..dfa0a6f 100644 --- a/login.js +++ b/login.js @@ -12,6 +12,9 @@ puppeteer.use( } )); +// Toggle browser for platform +const browser_path = "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"; +//const browser_path = '/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome'; const browser = await puppeteer.launch({ headless: false, @@ -19,7 +22,7 @@ const browser = await puppeteer.launch({ ignoreDefaultArgs: ["--disable-extensions"], dumpio: true, args: ["--start-maximized", "--no-sandbox", "--disable-setuid-sandbox"], - executablePath: "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe", + executablePath: browser_path, }); const page = await browser.newPage(); @@ -61,4 +64,4 @@ return json; fs.writeFileSync('./localStorage.json', JSON.stringify(localStorageData, null, 2)); console.log('Login session saved.'); -await browser.close(); \ No newline at end of file +await browser.close();