Scroll
Scroll
Section titled “Scroll”Type: page-scroll · Package: Browser v1.0.9
Scrolls the page. It has two uses: bringing an element into view (passing its selector) or scrolling the page by a number of pixels (with x/y). Useful on long pages, lists with progressive loading (infinite scroll) or to make sure an element is visible before interacting with it.
How it works
Section titled “How it works”- If you set a
selector, it scrolls as needed (the page and any scrollable containers) until that element is in view; if it already is, it does nothing. In this modexandyare ignored. - Otherwise, it scrolls the page window by the number of pixels given in
x(horizontal) andy(vertical). Positive values go down/right; negative values, the opposite. If you leaveyempty, it scrolls down500px.
To scroll an inner panel with its own scrollbar (a list inside a modal), use a selector of an element in that panel: scrolling the whole page won’t move it.
Required parameters
Section titled “Required parameters”None.
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
page | ZoanPageSession | — | The page session. Omit it inside a body; outside, pass the session variable (e.g. page = page). |
selector | selector | — | Element to bring into view. Empty = scroll the whole page. |
x | int | 0 | Pixels to scroll horizontally (without selector). |
y | int | 500 | Pixels to scroll vertically (without selector). E.g. 500 (down), -500 (up). |
Output
Section titled “Output”This activity does not return a value.
Example
Section titled “Example”Scroll down to load more results (infinite scroll):
For Loop from = 1 to = 6 indexVariable = i └─ activities: Page Scroll y = 1000 Delay milliseconds = 800 // give more items time to loadExtract Structured Data mode = smart cells = (.resultado) → output: resultadosBring a button into view before clicking it:
Page Scroll selector = (#botonPagar)Page Click selector = (#botonPagar)Common errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
Timeout 30000ms exceeded | With selector, the element didn’t appear or couldn’t be brought into view within 30 s. Check the selector or wait first with Wait For. |
'page' must be a ZoanPageSession. | page is empty outside a body. |
Related activities
Section titled “Related activities”- Wait For — wait for elements loaded while scrolling to appear.
- Extract Structured Data — for paginated tables (it handles moving forward for you).