The humanScroll is designed to simulate human-like scrolling behavior on a web page using puppeteer. It includes a combination of smooth and random scrolling movements to mimic natural user behavior.
- This function is intended to be used with puppeteer for browser automation.
constpuppeteer=require('puppeteer');(async()=>{constbrowser=awaitpuppeteer.launch();constpage=awaitbrowser.newPage();// Example usageconstscrollActions=awaithumanScroll(page);awaitscrollActions.scroll(3,'down');awaitbrowser.close();})();