Scroll Slowly to Bottom

Premades & Resources to be used with Helium Scraper 3
Post Reply
webmaster
Site Admin
Posts: 521
Joined: Mon Dec 06, 2010 8:39 am
Contact:

Scroll Slowly to Bottom

Post by webmaster » Thu Nov 19, 2020 8:11 pm

There are pages where the content won't load until we scroll down to where the content is located, and scrolling all the way to the bottom of the page at once sometimes fails to load the content. This premade scrolls slowly to the bottom of the page so all content is loaded.

It takes a speed argument, which sets the number of pixels to scroll per second and defaults to 2500. To use this on your project, follow these instructions.

Code: Select all

function (speed)
   State.Child
      ·  Browser.RunScript
            ·  "var e=null,o=()=>{var n=element.scrollTop;element.scrollTop+=argument/100,n<element.scrollTop?setTimeout(o,10):e()};return setTimeout(o,10),new Promise(o=>e=o)"
            ·  speed
If the scrollable area is not the whole page, add a selector that selects the scrollable element above this action:

Code: Select all

Select.ScrollableElement
ScrollSlowlyToBottom
   ·  2500
Juan Soldi
The Helium Scraper Team

Post Reply