How to use Puppeteer with the real Google Chrome on Mac
By default, when you install Puppeteer with
npm install
, it downloads a
recent version of Chromium that is guaranteed to work with the API.
If you are on MacOS and want to use the Google Chrome
already installed on your machine instead of the Chromium browser bundled with Puppeteer, you need to pass
the executablePath
argument when creating the browser instance:
const browser = await puppeteer.launch({
executablePath: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
});
executablePath
should point to
/Applications/Google Chrome.app/Contents/MacOS/Google Chrome
which is the location where Google
Chrome is installed.