I am trying to open a page through puppeteer but it's not throwing any error and entire code is getting executed by chromium doesn't show up.
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
console.log('there');
await page.goto('https://google.com');
console.log('yes');
// await page.screenshot({path: 'example.png'});
// await browser.close();
})();
When you install Puppeteer, it automatically downloads a recent version of Chromium (~170MB macOS, ~282MB Linux, ~280MB Windows) that is guaranteed to work with Puppeteer. For a version of Puppeteer without installation, see puppeteer-core .
(However, it is possible to force Puppeteer to use a separately-installed version Chrome instead of Chromium via the executablePath option to puppeteer. launch .
Puppeteer is a Node library which provides a high-level API to control headless Chrome or Chromium over the DevTools Protocol. It can also be configured to use full (non-headless) Chrome or Chromium.
Quote from the Puppeteer documentation:
Puppeteer launches Chromium in headless mode. To launch a full version of Chromium, set the 'headless' option when launching a browser:
const browser = await puppeteer.launch({headless: false}); // default is true
“Headless” means when your code is executed, you won't actually see any browser window, the code is run in the browser purely on the command line.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With