Scrolling
Scroll Horizontally
To scroll horizontally on a page, use the scroll_x instruction with the number of pixels you want to scroll.
If you want to scroll horizontally 1000px, you need to use this JavaScript scenario:
1{
2 "instructions": [
3 {"scroll_x": 1000}
4 ]
5}Scroll Vertically
To scroll vertically on a page, use the scroll_y instruction with the number of pixels you want to scroll.
If you want to scroll down 1000px, you need to use this JavaScript scenario:
1{
2 "instructions": [
3 {"scroll_y": 1000}
4 ]
5}Infinite Scrolling
To scroll the page until the end, use the infinite_scroll instruction with the configuration you want to use.
1{
2 "instructions": [
3 {
4 "infinite_scroll": {
5 "max_count": 0,
6 "delay": 1000,
7 "end_click": {
8 "selector": "#button_id",
9 "selector_type": "css"
10 }
11 }
12 }
13 ]
14}max_count: The maximum number of scrolls you want to do, 0 for infinite.
delay: The delay between each scroll, in ms.
end_click: (optional) A click instruction to click on a button when the end of the page is reached, usually a "load more" button. You can use both a CSS or XPath selector, but you will need to pass the correct selector_type value.
Note: This instruction is currently not supported when stealth proxies are used.