Act
See how to use act() to perform browser actions
Method Signatures
- TypeScript
- Python
Parameters
string
required
Natural language description of the action to perform.
Record<string, string>
Key-value pairs for variable substitution using
%variable% syntax. Prevents sensitive data from appearing in logs.AvailableModel
Override the default LLM model for this action.
ClientOptions
Model-specific configuration options.Options:
temperature, maxTokens, apiKeynumber
Maximum time to wait for DOM to stabilize before attempting action.Default:
30000number
Maximum time to wait for the action to complete.
boolean
Set to
true if target element is within an iframe.Default: falseObserveResult
Previously observed action to execute directly (enables self-healing).
Returns Promise<ActResult>
boolean
required
Whether the action was completed successfully.
string
required
Details about the action’s execution.
string
required
The action that was performed.
Response
Error Types
- TimeoutError - Action exceeded timeout limits
- ElementNotFoundError - Target element could not be located
- ActionFailedError - Action could not be completed
- StagehandError - General Stagehand-specific errors

