Skip to main content

search-filter Scenario 4 — Search with Wait and Extract First 10

Written by RTILA X Engineering Team

Intermediate ~6 min
Prerequisites: basic-navigation/1

What You'll Learn

Limit output and wait for dynamic content

Real-World Use Case

Extracting a fixed number of results

LIVE DEMO

Full Article Search

Search all thirty articles and observe the first ten matching results.

EXPECTED OUTPUT

First 10 Matches for 'the'

title url
The Future of Edge Computing in 2025 https://learn.rtila.com/articles/1
Hidden Gems of Southeast Asia https://learn.rtila.com/articles/5
The Rise of Headless E-Commerce https://learn.rtila.com/articles/7
The Benefits of Intermittent Fasting https://learn.rtila.com/articles/14
Backpacking the Dolomites https://learn.rtila.com/articles/15
The Evolution of Developer Tools https://learn.rtila.com/articles/16
Exploring the Camino de Santiago https://learn.rtila.com/articles/20
The Gut Microbiome and Health https://learn.rtila.com/articles/24
Understanding the Immune System https://learn.rtila.com/articles/28
Road Tripping the Norwegian Fjords https://learn.rtila.com/articles/29
RTILA X PROJECT JSON

RTILA X Automation Project

search-wait-extract-10.json
    {
  "name": "Search_Wait_Extract_First_10",
  "settings": {
    "urls": [
      "https://learn.rtila.com/scenarios/search-filter/4"
    ]
  },
  "datasets": {
    "search_results": {
      "item_selector": "css=.search-result",
      "properties": [
        {
          "name": "title",
          "type": "text",
          "selector": "css=h3.result-title"
        },
        {
          "name": "url",
          "type": "attribute",
          "selector": "css=a.result-url",
          "attribute": "href"
        }
      ]
    }
  },
  "commands": [
    {
      "command": "goto",
      "params": {
        "url": "https://learn.rtila.com/scenarios/search-filter/4"
      }
    },
    {
      "command": "wait_for_selector",
      "params": {
        "selector": "css=#search-input"
      }
    },
    {
      "command": "fill",
      "params": {
        "selector": "css=#search-input",
        "value": "the"
      }
    },
    {
      "command": "press",
      "params": {
        "selector": "css=#search-input",
        "key": "Enter"
      }
    },
    {
      "command": "wait_for_selector",
      "params": {
        "selector": "css=.results"
      }
    },
    {
      "command": "comment",
      "params": {
        "text": "Extract first 10 results only"
      }
    },
    {
      "command": "extract_data",
      "params": {
        "dataset": "search_results"
      }
    }
  ]
}
  

RTILA X Concepts

This scenario emphasizes waiting for .results before extraction and documents output limiting with a comment command. A real RTILA X run would apply a dataset-level limit or transform step after extracting all matches.

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?