05 · RPA API
Selectors and several profiles
How elements are found, and how to run one script on many profiles.
Pro plan2 min readUpdated November 2026
On this page
Selectors#
A bare string is CSS. Anything else takes a prefix.
| Selector | Meaning |
|---|---|
#login, div.card > a, input[name=q] | CSS (the default) |
text=Sign in | the element that directly contains this text (literal substring, not a regex) |
id=login | #login |
name=email | [name="email"] |
placeholder=Search | [placeholder*="Search"] |
aria=Close | [aria-label*="Close"] |
role=button | [role="button"] |
testid=submit | [data-testid="submit"] (also data-test, data-qa) |
class=btn-primary | .btn-primary |
xpath=//a[@id='x'] | a simple XPath subset converted to CSS (tags, [@a='v'], contains(), starts-with(), [N], and); unions and groups are rejected with a clear error |
- Actions and reads use the first match in document order. There is no
nth(): use CSS such asli:nth-of-type(3) a, orkryptix_query_allfor every match. - Visible means “rendered and inside the viewport”.
kryptix_visibleis false for an element scrolled out of view. Click, fill and hover scroll it into view for you, with the mouse wheel like a person. - Selectors apply to the current frame; use
kryptix_framefor iframes. They do not pierce shadow roots.
Several profiles#
Each profile has its own engine connection, so profiles run in parallel. Commands to one profile are queued, so use one thread per profile. With flat functions, pass page= to say which profile a call is for, or switch the current page with kryptix_use(page).
Python
from concurrent.futures import ThreadPoolExecutor from kryptix_rpa import * accounts = ["acct-1", "acct-2", "acct-3"] def job(name): page = kryptix_open(name) # sets the CURRENT page for this thread's call... kryptix_goto("https://example.com", page=page) # ...so pass page= when threads run in parallel return kryptix_title(page=page) with ThreadPoolExecutor(3) as pool: print(list(pool.map(job, accounts)))
Node.js
import { kryptix_open, kryptix_goto, kryptix_title } from "./kryptix_rpa.mjs"; const titles = await Promise.all(["acct-1", "acct-2", "acct-3"].map(async (name) => { const page = await kryptix_open(name); await kryptix_goto("https://example.com", { page }); // page: tells it which profile return kryptix_title({ page }); })); console.log(titles);