Skip to main content

search-filter Scenario 3 — Apply Price Range Filter and Scrape

Written by RTILA X Engineering Team

Intermediate ~6 min
Prerequisites: basic-navigation/1

What You'll Learn

Combine multiple form inputs to filter results

Real-World Use Case

Setting price range and brand filters

LIVE DEMO

Price Range Filter

Filter all products by a $100 to $500 price range and extract the results.

48 products found

Wireless Noise-Cancelling Headphones $249.99Electronics
4K Ultra HD Monitor $499.99Electronics
Mechanical Gaming Keyboard $129.99Electronics
USB-C Docking Station $159.99Electronics
Portable SSD 1TB $99.99Electronics
Smart Home Hub $79.99Electronics
Wireless Charging Pad $29.99Electronics
Bluetooth Speaker $59.99Electronics
Classic Cotton T-Shirt $19.99Clothing
Slim Fit Jeans $69.99Clothing
Waterproof Rain Jacket $119.99Clothing
Running Sneakers $129.99Clothing
Wool Blend Sweater $89.99Clothing
Leather Belt $39.99Clothing
Sun Hat $24.99Clothing
Sport Socks Pack $9.99Clothing
JavaScript: The Good Parts $16.95Books
Design Patterns Explained $28.99Books
Data Structures in Python $49.99Books
Machine Learning Basics $39.99Books
Web Scraping Handbook $34.99Books
API Design Guide $42.50Books
DevOps Best Practices $36.00Books
Clean Architecture $31.99Books
Stainless Steel Cookware Set $199.99Home & Garden
Robot Vacuum Cleaner $299.99Home & Garden
Indoor Plant Pot Set $34.99Home & Garden
LED Desk Lamp $44.99Home & Garden
Bamboo Cutting Board $27.99Home & Garden
Garden Tool Set $54.99Home & Garden
Scented Candle Collection $39.99Home & Garden
Throw Blanket $49.99Home & Garden
Yoga Mat Premium $39.99Sports
Adjustable Dumbbells $329.99Sports
Running Water Bottle $19.99Sports
Resistance Bands Set $24.99Sports
Tennis Racket Pro $149.99Sports
Cycling Helmet $59.99Sports
Jump Rope Speed $12.99Sports
Foam Roller Recovery $27.99Sports
Building Blocks Set $49.99Toys
Remote Control Car $79.99Toys
Board Game Strategy $34.99Toys
Puzzle 1000 Pieces $19.99Toys
Action Figure Collection $89.99Toys
Art Supplies Kit $29.99Toys
Science Experiment Kit $54.99Toys
Plush Bear Large $22.99Toys
EXPECTED OUTPUT

Products $100 to $500

name price category
Wireless Noise-Cancelling Headphones $249.99 Electronics
4K Ultra HD Monitor $499.99 Electronics
Mechanical Gaming Keyboard $129.99 Electronics
USB-C Docking Station $159.99 Electronics
Waterproof Rain Jacket $119.99 Clothing
Running Sneakers $129.99 Clothing
Stainless Steel Cookware Set $199.99 Home & Garden
Robot Vacuum Cleaner $299.99 Home & Garden
Adjustable Dumbbells $329.99 Sports
Tennis Racket Pro $149.99 Sports
RTILA X PROJECT JSON

RTILA X Automation Project

price-range-scrape.json
    {
  "name": "Apply_Price_Range_And_Scrape",
  "settings": {
    "urls": [
      "https://learn.rtila.com/scenarios/search-filter/3"
    ]
  },
  "datasets": {
    "price_filtered": {
      "item_selector": "css=.filter-result",
      "properties": [
        {
          "name": "name",
          "type": "text",
          "selector": "css=.result-name"
        },
        {
          "name": "price",
          "type": "text",
          "selector": "css=.result-price"
        },
        {
          "name": "category",
          "type": "text",
          "selector": "css=.result-category"
        }
      ]
    }
  },
  "commands": [
    {
      "command": "goto",
      "params": {
        "url": "https://learn.rtila.com/scenarios/search-filter/3"
      }
    },
    {
      "command": "wait_for_selector",
      "params": {
        "selector": "css=#min-price"
      }
    },
    {
      "command": "fill",
      "params": {
        "selector": "css=#min-price",
        "value": "100"
      }
    },
    {
      "command": "fill",
      "params": {
        "selector": "css=#max-price",
        "value": "500"
      }
    },
    {
      "command": "click",
      "params": {
        "selector": "css=#apply-filter"
      }
    },
    {
      "command": "wait_for_selector",
      "params": {
        "selector": "css=.filtered-results .filter-result"
      }
    },
    {
      "command": "extract_data",
      "params": {
        "dataset": "price_filtered"
      }
    }
  ]
}
  

RTILA X Concepts

fill accepts numeric text for number inputs, click applies the filter, and wait_for_selector protects against reading an empty result list before Vue has updated the DOM.

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 3 RTILA X commands and is referenced in 2 learning articles.

Continue Learning

Was this helpful?