puppeteer-auto-position

1.0.2 • Public • Published

Puppeteer Auto Position

demo

A simple Puppeteer module that automatically sets window positions when launching new browsers.

Installation

npm install puppeteer-auto-position

Usage

const { puppeteerWindow } = require('puppeteer-auto-position');

(async () => {
    const browsers = [];
    for(let i=0; i<6; i++){
        const browser = await puppeteerWindow(i);
        browsers.push(browser);
    }

    for(const browser of browsers){
        const page = await browser.newPage();
        await page.goto("https://google.com");
        // Do something with the page...
    }

})();

Options

The puppeteerWindow function takes an optional second argument, an options object where you can specify the width, height, and screenWidth:

const browser = await puppeteerWindow(i, {
    width: 800, // default is 640
    height: 600, // default is 480
    screenWidth: 1920 // default is 1920
});

Readme

Keywords

none

Package Sidebar

Install

npm i puppeteer-auto-position

Weekly Downloads

3

Version

1.0.2

License

ISC

Unpacked Size

4.03 kB

Total Files

5

Last publish

Collaborators

  • fdcicyber