Skip to main content
Actions allow you to interact with a web page before scraping its content. This is useful for:
  • Clicking “Load More” buttons to reveal additional content
  • Filling out forms and logging in
  • Scrolling to trigger lazy-loaded content
  • Taking screenshots at different stages of interaction
  • Executing custom JavaScript

Available Actions

Actions are executed sequentially in the order they are provided. Each action is performed before the final scrape.

Wait

Pause execution for a specified amount of time or until an element appears.

Click

Click on an element identified by a CSS selector.
Set "all": true to click all elements matching the selector. This is useful for expanding multiple sections at once.

Write

Type text into input fields, text areas, or contenteditable elements.
You must first focus the element using a ‘click’ action before writing. The text will be typed character by character to simulate keyboard input.

Press

Press a keyboard key. Useful for navigation, submitting forms, or triggering keyboard shortcuts.
See key codes reference for available key values.

Scroll

Scroll the page or a specific element to reveal lazy-loaded content.

Screenshot

Take a screenshot during action execution. Screenshots are returned in the response’s actions.screenshots array.

Scrape

Scrape the current page content during action execution. Results are returned in the response’s actions.scrapes array.

Execute JavaScript

Execute custom JavaScript code on the page. The return value is available in the response’s actions.javascriptReturns array.

Complete Example: Login Flow

Here’s a complete example showing how to combine multiple actions to log into a website:

Best Practices

Add wait times between actions: Pages need time to respond to interactions. Add wait actions with appropriate delays after clicks, scrolls, or form submissions.
Use specific selectors: Be as specific as possible with CSS selectors to ensure you’re targeting the correct elements. Use IDs when available.
Test action sequences: Test your action sequences in a browser’s developer tools first to ensure they work as expected.
Using actions with sensitive data (like login credentials) will set storeInCache to false automatically for security purposes.