title: How to fetch pageXOffset and pageYOffset in puppeteer/playwright
body: <p>I would like to fetch pageXOffset &amp; pageYOffset for the element. Here is code I have tried</p>
  <pre><code>        const pageXOffset = await page.evaluate(()=&gt;window.pageXOffset)
          const pageYOffset = await page.evaluate(() =&gt; window.pageYOffset)
  </code></pre>
  <p>where <code>element</code> is <code>ElementHandle</code>.
  But somehow I get Offset values to be zero. Wondering what I am missing over here</p>