Skip to content

Get Text

Type: page-get-text  ·  Package: Browser v1.0.9  ·  Output: string

Reads the visible text of an element (its innerText) and returns it as a string. It’s the key activity for extracting data from a page: a total, a name, a status message, the result of a search.

It locates the element by its selector, waits for it to exist on the page (up to timeout) and returns its visible text, including that of its child elements. Store the result in an output variable to use it later.

  • It returns the text as you see it: it keeps line breaks between blocks and leaves out text hidden with CSS.
  • The text isn’t written to the log (it may be business data): the log only says which element it was read from.
ParameterTypeDefaultDescription
selectorselector—The element whose text you want to read.
ParameterTypeDefaultDescription
pageZoanPageSession—The page session. Omit it inside a body; outside, pass the session variable (e.g. page = page).
timeoutnumber30000Maximum time in ms to wait for the element. Empty, 0 or negative: the project settings value or, if none, 30000.

Returns a string with the visible text. If the element exists but has no text (or is hidden), it returns "". Store it in a variable (the Output field).

Page Get Text selector = (.saldo-actual) → output: saldoTexto
Set Variable name = saldo value = parseDouble(replace(replace(saldoTexto, "$", ""), ",", ""))
Log message = "Balance: " + saldo
MessageCause and fix
Timeout 30000ms exceededThe element didn’t appear in time. Check the selector or wait first with Wait For.
strict mode violation: … resolved to 2 elementsThe selector matches several elements. Make it more specific or add an index. To read many values at once, use Extract Structured Data.
'page' must be a ZoanPageSession.page is empty outside a body.