How to close the browser instance in Puppeteer?

In Puppeteer, you can close the browser instance by calling the browser.close() method. Here is an example:

const puppeteer = require('puppeteer'); (async () => { const browser = await puppeteer.launch(); const page = await browser.newPage(); // do something await browser.close(); })();

In this example, we first launch a new browser instance using puppeteer.launch(), and then create a new page. After performing any necessary actions on the page, we call browser.close() to close the browser instance.