Selectors
Selectors tell RTILA which element(s) on the page to interact with or extract data from.
Selector Types
Section titled “Selector Types”| Type | Syntax | Description |
|---|---|---|
| CSS | css=.product-card |
Standard CSS selector |
| XPath | xpath=//div[@class='product'] |
XPath expression |
| Text | text=Click Me |
Exact text match |
| Variable | variable=my_var |
Value of a runtime variable |
CSS Selectors
Section titled “CSS Selectors”CSS selectors are the most common and versatile type.
| Selector | Matches |
|---|---|
css=.product-card |
Elements with class product-card |
css=#main-content |
Element with ID main-content |
css=div.product |
<div> elements with class product |
css=div.product h2 |
<h2> inside <div class="product"> |
css=a[href^="https"] |
Links starting with https |
css=input[name="email"] |
Input with name attribute email |
css=div:nth-of-type(2) |
Second <div> sibling |
css=div.product:first-child |
First child with class product |
XPath Selectors
Section titled “XPath Selectors”Use XPath for complex queries that CSS can’t handle.
| Selector | Matches |
|---|---|
xpath=//div[@class='product'] |
Divs with class product |
xpath=//a[contains(text(), 'Next')] |
Links containing “Next” |
xpath=//div[@id='main']//h2 |
H2 inside div#main |
xpath=//table//tr[position()>1] |
Table rows except the first |
Text Selectors
Section titled “Text Selectors”Match elements by their exact text content.
text=Click Metext=Add to Carttext=Next PageNote: Text selectors match exact text. Partial matches are not supported.
Variable Selectors
Section titled “Variable Selectors”Extract the value of a runtime variable as a dataset property.
variable=my_variableThis is useful when you want to include a runtime value in your extracted data.
Choosing the Right Selector
Section titled “Choosing the Right Selector”| Scenario | Recommended Selector |
|---|---|
| Simple element with a class | css=.class-name |
| Element with a unique ID | css=#element-id |
| Element inside a specific parent | css=parent > child |
| Element by attribute | css=[data-id="123"] |
| Complex nested structure | xpath=//div[@class='parent']//span |
| Element by visible text | text=Exact Text |
| Dynamic value from a variable | variable=var_name |
Selector Tips
Section titled “Selector Tips”| Tip | Description |
|---|---|
| Prefer IDs and classes | They’re more stable than positional selectors |
| Avoid auto-generated classes | Classes like .css-1a2b3c or .sc-xyz change frequently |
| Use data attributes | data-id, data-product-id are stable |
| Use aria-label | aria-label attributes are stable and descriptive |
| Test selectors | Use the element picker in the Visual Builder to verify selectors |
| Avoid nth-child when possible | Position-based selectors break when content changes |
Using the Element Picker
Section titled “Using the Element Picker”The easiest way to create selectors:
- Open the project in the Visual Builder.
- Click the pointer icon next to any selector field.
- Click an element on the page.
- The selector is auto-generated and filled in.

Iframe Selectors
Section titled “Iframe Selectors”If the target element is inside an iframe, specify the iframe selector separately:
| Parameter | Description |
|---|---|
iframe |
Selector for the iframe (e.g., css=iframe#my-frame) |
selector |
Selector for the element inside the iframe |