Skip to content

Scroll element

Scrolls an element to specific coordinates.

Element Selector

Enter the element selector you want to scroll to.

Selector Options

Select the desired options.

To Horizontal Coordinate

Scroll horizontally to the coordinate entered by the user.

To Vertical Coordinate

Scroll vertically to the coordinate entered by the user.

Scroll to Target

Scroll until the matching element is visible in the browser window.

Smooth Scroll

The scrollbar scrolls more smoothly without being abrupt.

Scroll Horizontally by Offset

Scroll a horizontal distance entered by the user. Based on the distance value provided.

When selecting the Scroll Horizontally by Offset option, the To Horizontal Coordinate (px) field changes to Scroll by X (px). Entering a positive value scrolls to the right, and a negative value scrolls to the left.

Scroll by X (px)

Scroll an additional horizontal distance. The scroll distance can be entered using a function, for example, the function {{$randint(500,600)}} will generate a random value between 500 and 600 and scroll by that value.

Scroll Vertically by Offset

Scroll a vertical distance entered by the user. Based on the distance value provided.

When selecting the Scroll Vertically by Offset option, the To Vertical Coordinate (px) field changes to Scroll by Y (px). Entering a positive value scrolls downward, and a negative value scrolls upward.

Scroll by Y (px)

Scroll an additional vertical distance. The scroll distance can be entered using a function, for example, the function {{$randint(500,600)}} will generate a random value between 500 and 600 and scroll by that value.

Practical Examples

Scroll by Y (px) Normally

Example

For example, a workflow visits the Etsy page and scrolls down to view products.

scroll

To achieve this, you will configure the Scroll element node as follows:

First, select the CSS selector for the node. Here, you will choose to scroll using the CSS Selector with the selector html, which means scrolling the entire page. Next, select Smooth Scroll to ensure smooth scrolling without jerking. Then, select Scroll Vertically by Offset to scroll to a desired level. Finally, choose the distance to scroll; here, you don’t need to worry about what px means, just enter a number and adjust to achieve the desired scroll distance, for example, you want to scroll by 1000px. The node will be configured as follows:

scroll

Additionally, you can combine this with the Repeat task node to break the long scroll into smaller segments and repeat multiple times.

scroll

scroll

Successfully Scroll a Page

Example

Typically, when scrolling a page, you use the global CSS selector like html.

However, in some cases, a page has multiple scrollable regions, and you cannot use the html selector to scroll. Instead, you need to use the selector of the specific region, as follows:

For example, on this Discord page, you want to scroll the chat section to view messages in the channel.

scroll

If you use the html selector, the node will run but won’t scroll because there are multiple scrollable regions on this page.

scroll

Therefore, you need to obtain the selector for the chat region of the channel. Here, you will use the selector main>[class*="messagesWrapper"] [class*="scroller"] in the Scroll element node with the following configuration:

scroll

When running this node, you can see the messaging region being scrolled down.

scroll

Scroll Successfully on Most Pages

Example

Typically, when scrolling a page, you use the global CSS selector like html.

However, in some cases, a page has multiple scrollable regions, and, you cannot use the html selector to scroll. Therefore, you need to use the selector of the specific region instead of the entire page. However, some pages make it quite difficult to obtain the selector.

To address this, you can configure the Scroll element node as follows to scroll on the Discord page below:

scroll

scroll

When running this node, you can see the messaging region being scrolled down.

scroll

Scroll Until Element Appears

Example

For example, you want to scroll to the section displaying related products on a product page and then perform subsequent actions.

scrollscroll

To achieve this, you need to configure the Scroll element node as follows:

scroll

In addition to scrolling, you need to use the Condition node to ensure the element is visible on the screen before stopping the scroll.

First, you need to obtain the selector for the related products section, which is [id="image-tags"], and then configure the Element visible in screen option to stop scrolling when the element is visible on the screen.

The node configuration will be as follows:

scroll

When running, you will achieve the desired result as initially intended.

scroll