Reputation: 2708
Why can I not load Chrome in the browser? I get error:
The message is Failed to launch the browser process! spawn /Applications/GoogleChrome.app ENOENT TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
Node version v13.12.0
const browser = await puppeteer.launch({executablePath:'/Applications/Google\Chrome.app'});
const page = await browser.newPage();
await page.goto('https://my.gumtree.com/login', {waitUntil: 'networkidle2'});
const myButton = await page.$('#google-sign-in-button');
myButton.click();
Upvotes: 4
Views: 4161
Reputation: 868
A more straightforward solution:
const browser = await puppeteer.launch({executablePath: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'});
executablePath: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
Hope that helps
Upvotes: 1
Reputation: 85
If you want to launch puppeteer with already installed chronium, you need to set executablePath
. So please check the exact path of chronium.
chrome://version/
in your chrome.executablePath
.const browser = await puppeteer.launch({executablePath:'your executable Path'});
const page = await browser.newPage();
await page.goto('https://my.gumtree.com/login', {waitUntil: 'networkidle2'});
const myButton = await page.$('#google-sign-in-button');
myButton.click();
Upvotes: 7