Skip to main content

loops Scenario 3 — Wait for Loading Spinner and Extract

Written by RTILA X Engineering Team

Intermediate ~6 min
Prerequisites: loops/1 loops/2

What You'll Learn

Poll for a loading spinner to disappear

Real-World Use Case

Waiting for dynamic content to load

LIVE DEMO

Loading Spinner Poll

A feed that shows a spinner for two seconds before posts render.

Loading posts...
EXPECTED OUTPUT

Posts

content author
Automation is the closest thing we have to superpowers. Start small, then scale. techguru42
Selectors are the foundation of every reliable web scraper. Master them early. dataminer_sam
Just deployed my first pipeline using RTILA X. The JSON config model is incredibly clean. scraper_queen
Learning automation by pointing tools at deterministic demo pages is a game changer. automation_alice
CSS attribute selectors solved a scraping challenge I had been avoiding for weeks. selector_sam
Stable URLs and semantic markup make automation 100x easier. css_crusader
Every demo I build now includes expected outputs. Self-verification is the best way to learn. json_jess
XPath is verbose, but for complex DOM traversal it remains extremely powerful. xpath_xavier
RTILA X PROJECT JSON

RTILA X Automation Project

wait-for-loading-spinner.json
{
  "name": "Wait_For_Loading_Spinner",
  "settings": {
    "urls": [
      "https://learn.rtila.com/scenarios/loops/3"
    ]
  },
  "datasets": {
    "posts": {
      "item_selector": "css=.post-item",
      "properties": [
        {
          "name": "content",
          "type": "text",
          "selector": "css=.post-content"
        },
        {
          "name": "author",
          "type": "text",
          "selector": "css=.post-author"
        }
      ]
    }
  },
  "commands": [
    {
      "command": "while",
      "params": {
        "condition": {
          "type": "element_visible",
          "selector": "css=.loading-spinner"
        },
        "do": [
          {
            "command": "wait",
            "params": {
              "timeout": 2000
            }
          }
        ]
      }
    },
    {
      "command": "wait_for_selector",
      "params": {
        "selector": "css=.post-item"
      }
    },
    {
      "command": "extract_data",
      "params": {
        "dataset": "posts"
      }
    }
  ]
}

RTILA X Concepts

A while loop can poll for a loading indicator. Once the spinner is no longer visible, the automation waits for the post items and extracts them.

Did you complete this scenario?

Ready to run this automation?

Copy the project JSON above, open RTILA X, create a new project, and paste it.

This scenario covers 2 RTILA X commands and is referenced in 2 learning articles.

Continue Learning

Was this helpful?