function main(splash) local num_scrolls = 20 local scroll_delay = 0.8 local scroll_to = splash:jsfunc("window.scrollTo") local get_body_height = splash:jsfunc( "function() {return document.body.scrollHeight;}" ) assert(splash:go(splash.args.url)) splash:wait(splash.args.wait) for _ = 1, num_scrolls do scroll_to(0, get_body_height()) splash:wait(scroll_delay) end return splash:html() end