Created
          May 1, 2020 12:54 
        
      - 
      
 - 
        
Save vickyRathee/7ecdeefe322b0196648b6d0475a68eb9 to your computer and use it in GitHub Desktop.  
    Infinite scrolling script to keep scrolling with 100ms delay https://www.agenty.com/docs/scraping-agent/infinite-scrolling-load-more-and-next-click-pagination-in-web-scraping
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | var totalHeight = 0; | |
| var distance = 100; | |
| var timer = setInterval(() => { | |
| var scrollHeight = document.body.scrollHeight; | |
| window.scrollBy(0, distance); | |
| totalHeight += distance; | |
| if (totalHeight >= scrollHeight) { | |
| clearInterval(timer); | |
| } | |
| }, 100); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment