To use Puppeteer with an existing installation of Chrome on MacOS, you can follow these steps:
Install Puppeteer by running the command npm install puppeteer
in your terminal.
Verify that Puppeteer has downloaded the correct version of Chromium by running node -e 'console.log(require("puppeteer/package.json").puppeteer.chromium_revision)'
Locate the Chrome executable file on your MacOS system. This can typically be found in the Applications
folder. Copy the path to the executable file.
Launch Puppeteer by passing the path to the Chrome executable file as a custom argument when creating a new Puppeteer instance.
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({
executablePath: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
});
const page = await browser.newPage();
await page.goto('https://www.google.com');
// Other Puppeteer code here
await browser.close();
})();
You can then use Puppeteer with your existing installation of Chrome on MacOS, and any configurations or extensions that you have installed should be available.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2023-01-09 11:00:00 +0000
Seen: 12 times
Last updated: Nov 29 '22
How can a python script be executed using a chrome extension?
How can Chrome be set up to detect SSL certificates from Wamp Apache?
How can I add an Angular back button to the stack router outlet in Chrome?
How to turn off the automatic update feature of Google Chrome on Windows 11?
Is there a way to add JS code to Chrome without using an extension?
How to change the URL in a Chrome extension?
How can one create a PDF using the Selenium Chrome driver?
How to look for information within a JSON object using Google Chrome DevTools?