Skip to main content
Written by Marcus Chen - Staff Platform Engineer

Experience is just the process of learning what not to do. These best practices are drawn from the common failure modes seen across the 129 practice scenarios on learn.rtila.com.

Selector Strategy

  • Prefer IDs and data attributes.
  • Use semantic class names.
  • Avoid nth-child.
  • Compare selectors against the LIVE DEMO HTML.
  • Add fallback selectors for A/B tested pages.

Wait Patterns

Always place a wait_for_selector before clicks and extraction. The wait should target an element that indicates the page is ready, not the element you are about to click.

{
  "command": "wait_for_selector",
  "params": {
    "selector": "css=.results-loaded",
    "timeout": 10000
  }
}

Error Handling

Every target page should have a fallback plan. Simple while retries are good for spinners. try_catch is better for branching errors.

Data Validation

Validate row counts and required fields before relying on output. Use required_fields to drop incomplete rows and deduplicate_by to remove duplicates.

Performance Optimization

  • Extract only the fields you need.
  • Use direct HTTP requests where the site exposes JSON.
  • Avoid excessive scrolling without a termination condition.
  • Run single-worker jobs for sensitive sites.

Top 10 Configuration Mistakes

  1. Using ${var} syntax in a trigger.
  2. Using {var} syntax in a command parameter.
  3. Missing wait_for_selector before a click.
  4. Using a selector that does not exist in the demo.
  5. Forgetting to escape regex slashes in JSON.
  6. Returning partial JSON with a trailing comma.
  7. Mixing http:// URLs into production settings.
  8. Using Math.random() or Date.now() in demo components.
  9. Hardcoding credentials in project files.
  10. Skipping the expected output comparison step.

Try It Yourself

Open each Error Handling scenario after reviewing this article. Identify which best practice is missing in each example and compare the broken behavior with the corrected JSON block.

Was this helpful?

โ† Back to Learning Hub