The Loop Elements block allows you to process multiple elements on a webpage, such as product listings, comments, or any repeating content. Use it to scrape data, click through items, or handle dynamic content.

Inputs

☐ Description (Optional)

A brief note explaining what elements this loop will process.

Good Examples:

  • “Extract all product prices from search results”
  • “Click through each pagination link”
  • “Process all comments on the page”

☐ Element Selection (Required)

Choose how to identify the elements to loop through:

CSS Selector or XPath

Description: Define which elements to process on the page.

Features:

    ☐ Use CSS selectors (e.g., .product-card)

    ☐ Use XPath expressions

    ☐ Match multiple elements at once

Example Use Case: Select all product cards with class .product-card

☐ Load More Elements (Optional)

Configure how to handle dynamically loaded content:

Click Element

Description: Click a button or link to load more items.

Settings:

    ☐ Element to click (e.g., “Load More” button)

    ☐ Wait time after clicking

    ☐ Maximum attempts to load more

Example Use Case: Click “Show More” button to load additional comments

Scroll Action

Description: Scroll the page to trigger lazy loading.

Settings:

    ☐ Scroll direction (up/down)

    ☐ Wait time after scrolling

    ☐ Scroll to top/bottom option

Example Use Case: Scroll down to load more products in infinite scroll

Next Page

Description: Navigate through paginated content.

Settings:

    ☐ Next page link selector

    ☐ Wait time for page load

    ☐ Maximum pages to process

Example Use Case: Click through search result pages

Usage Examples

1. Product Scraping

Selector.product-item
Max Items20
Load MoreScroll Down
Wait Time5 seconds
Scroll To✓ Bottom
Extracts product information from an infinite scroll page, loading 20 items

2. Blog Articles

Selector.article-item
Max Items50
Load MoreClick Link
Next Link.next-page
Wait Time3 seconds
Scrapes blog articles across multiple pages using pagination

3. Comment Processing

Selector.comment-item
Max Items30
Load MoreClick Element
Button.show-more-comments
Wait Time4 seconds
Process comments that load via “Show More” button, up to 30 items

4. Message History

Selector.message
Max Items0 (no limit)
Reverse Order✓ Enabled
Process all messages in reverse chronological order

5. Social Media Feed

Selector.post-container
Max Items100
Load MoreScroll Down
Wait Time2 seconds
Load social media posts through infinite scroll

6. Review Collection

Selector.review-box
Max Items200
Load MoreClick Element
Button.load-more-reviews
Collect product reviews using load more button

Notes

  • Test selectors to ensure they match the correct elements
  • Set appropriate wait times for dynamic content
  • Consider using Loop Breakpoint during testing
  • Handle errors when elements fail to load