Features
Page Interactions
Use the jsScenario
parameter to simulate user interactions on the page before scraping. This enables you to handle dynamic pages that require clicking, waiting, or filling inputs to reveal content.
The value of jsScenario
is an array of steps, executed sequentially. Each step is an object that defines a single action (e.g. click, scroll, wait, fill).
Supported Actions
click
– Click an element using a CSS selectorwait
– Pause for a specific time (in milliseconds)waitFor
– Wait until an element appears in the DOMwaitForAndClick
– Wait for an element and click itevaluate
– Run custom JavaScript in the page contextscrollX
,scrollY
– Scroll to a horizontal or vertical offsetfill
– Input values into fields using selectors
All actions are executed in order, one after another
Example: Load More and Scroll
This sequence clicks a button, waits and then scrolls the page.
Example: Fill and Submit a Form
This fills an email field, clicks the submit button, and waits for a confirmation message.
Example: Evaluate Custom JS
This runs arbitrary JavaScript in the browser context before scraping.
Notes
- If an element is not found (e.g.
click
orwaitFor
), the request will fail jsRendering
must be set totrue
forjsScenario
to work- Use
wait
conservatively - preferwaitFor
to avoid unnecessary delays