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
- Using
${var}syntax in a trigger. - Using
{var}syntax in a command parameter. - Missing
wait_for_selectorbefore a click. - Using a selector that does not exist in the demo.
- Forgetting to escape regex slashes in JSON.
- Returning partial JSON with a trailing comma.
- Mixing
http://URLs into production settings. - Using
Math.random()orDate.now()in demo components. - Hardcoding credentials in project files.
- 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?
Thank you for your feedback!