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).
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 selectorsclick
or waitFor
), the request will failjsRendering
must be set to true
for jsScenario
to workwait
conservatively - prefer waitFor
to avoid unnecessary delays