add mac browser path

main
Ibraheem Saleh 10 months ago
parent d9839f21ea
commit 1458f3071c

@ -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());

@ -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();

Loading…
Cancel
Save