Ask Your Question

Revision history [back]

To use Puppeteer with an existing installation of Chrome on MacOS, you can follow these steps:

  1. Install Puppeteer by running the command npm install puppeteer in your terminal.

  2. Verify that Puppeteer has downloaded the correct version of Chromium by running node -e 'console.log(require("puppeteer/package.json").puppeteer.chromium_revision)'

  3. 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.

  4. 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();
    })();
    
  5. 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.