Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

save file as get dimensions puppeteer js

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto('https://example.com');

  // Get the "viewport" of the page, as reported by the page.
  const dimensions = await page.evaluate(() => {
    return {
      width: document.documentElement.clientWidth,
      height: document.documentElement.clientHeight,
      deviceScaleFactor: window.devicePixelRatio,
    };
  });

  console.log('Dimensions:', dimensions);

  await browser.close();
})();
Comment

PREVIOUS NEXT
Code Example
Javascript :: sentry reports too much recursion 
Javascript :: visio prevent arrows from snapping 
Javascript :: npm dinosaur game 
Javascript :: React.createElement pass props 
Javascript :: regex not before 
Javascript :: graal.js javascript array in java 
Javascript :: pASS - EXE 
Javascript :: jshint defined variable which are coming from different file 
Javascript :: why is necessary to run react-native run 
Javascript :: javascript promises mdn 
Javascript :: asyncGenerator 
Javascript :: node load testing-basic 
Javascript :: js convert charcode to char 
Javascript :: switch case in jsx 
Javascript :: Snail array 
Javascript :: parsing error cannot find module 
Javascript :: javascript return strung 
Javascript :: Masonry js css 
Javascript :: javascript remove null object 
Javascript :: hello worled anglular script 
Javascript :: how to refrence schema in my mongoose schema with populate function 
Javascript :: Vue Apexchart LineChart 
Javascript :: Set objects Relation with Strings javascript 
Javascript :: java script discord timer 
Javascript :: delete head array js 
Javascript :: nextjs update ui when data is updated 
Javascript :: ngclass click change toggle 
Javascript :: Check if something is a function 
Javascript :: _.has Creator Functions Do Not Have "Constructor" 
Javascript :: Backbone.model first parameter determines properties that each instance must have 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =