Skip to main content
Use if_else_node for conditional execution based on runtime conditions—handling different page states, optional elements, or branching logic. To determine condition logic, use extraction actions to capture data from the page and store it as variables. These variables are then referenced in if_else_node conditions to make branching decisions based on the extracted data.

Structure

Note: Variables like has_captcha are extracted from the page using an extraction action (see Using Extraction Nodes to Set Conditions below).

Properties

PropertyTypeDescription
conditionstrPython-like expression to evaluate
if_nodeslist[action_node | if_else_node | for_loop_node]Actions when condition is true
else_nodeslist[...]Actions when condition is false (optional)

Using Extraction Nodes to Set Conditions

Extraction nodes allow you to capture data from the page and store it as variables. These variables can then be referenced in if_else_node conditions to make branching decisions based on the extracted data.

How It Works

  1. Extract data using an extraction_action and specify output_variable_names to create a variable
  2. Reference the variable in an if_else_node condition using the syntax variable_name[0]
  3. Branch logic executes different paths based on the extracted value

Variable Naming and Syntax

  • Variables are referenced using array index syntax: variable_name[0]
  • The [0] accesses the first (or only) element of the extracted value
  • Multiple extractions create arrays: variable_name[0], variable_name[1], etc.

Condition Syntax

Conditions are Python-like expressions that can reference parameters:

Operators

OperatorExample
Equalityvar[0] == 'value'
Inequalityvar[0] != 'value'
None checkvar[0] is not None
Booleanvar[0] == 'true'
Logical ANDa[0] == 'x' and b[0] == 'y'
Logical ORa[0] == 'x' or b[0] == 'y'

Examples

Extract and Check Page State

Handle Optional 2FA

Branch Based on Extracted Value

Nested Conditions

else_nodes is optional. If omitted or empty, nothing happens when condition is false.