Skip to main content

One post tagged with "Puppeteer"

View All Tags

ยท 5 min read
Richard Haar

Browsing without a GUI#

Puppeteer allows you to control a Chrome or Chromium instance using NodeJs. The real benefit is running Puppeteer as a headless browser, meaning you don't have any GUI to interact with but you can navigate pages, interact with buttons and take screenshots all from your node script. For example:

 const puppeteer = require('puppeteer');  async function screenshot() {     const browser = await puppeteer.launch({});     const page = await browser.newPage();     await page.goto('https://www.google.com');     await page.screenshot({path: 'GoogleOn' + new Date().toDateString() + '.png'});     browser.close(); }  screenshot();