title: Scroll to the bottom solutions not always going to the absolute end of the page
body: <p><strong>scenario</strong></p>
  
  <p>I am scraping the comments from a YouTube video's page using Puppeteer. The ajax call to fetch more comments is called when we scroll to the absolute bottom of the page, thus I need to scroll to the bottom. </p>
  
  <p><strong>problem</strong></p>
  
  <p>The problem is I am not able to; even if I apply a scrolling to bottom solution it sometimes does not scroll to the end of the page, means it goes to the bottom, but not absolute bottom, leaving some gap below, because of which the ajax call is not triggered</p>
  
  <p><strong>solutions I have tried</strong></p>
  
  <ol>
  <li>the page.scroll() function of puppteer [failed].</li>
  <li><code>document.querySelector('body').scrollIntoView({block: "end"})</code> [not working on youtube pages, working only on some websites]</li>
  <li><code>document.scrollingElement.scrollTop =(document.scrollingElement.scrollHeight)</code> [at times does not go to the absolute bottom]</li>
  <li><code>document.scrollingElement.scrollTop =(document.scrollingElement.scrollHeight) + 999999</code> [same as above]</li>
  <li><code>window.scrollBy() &amp; window.scrollTo()</code></li>
  </ol>
  
  <p>There could be one or more JS solutions I have tried and failed to solve the problem.</p>
  
  <p>PS since I am working on puppeteer, browser compatibility on other browsers like firefox or IE not required I suppose</p>