Skip to content

API Reference ​

Core classes, DTOs, and interfaces in Lablnet\StepWright.

Orchestrator Class ​

Lablnet\StepWright\StepWright ​

The main entry point for running scraping operations.

php
public static function runScraper(
    array $templates,
    RunOptions $options = new RunOptions(),
    ?BrowserDriverInterface $driver = null,
    ?callable $onResult = null,
    ?callable $onStatus = null
): array

Data Transfer Objects (DTOs) ​

Lablnet\StepWright\DTOs\BaseStep ​

Represents an individual step in a template workflow.

PropertyTypeDefaultDescription
idstringrequiredUnique identifier for the step
actionActionType|stringrequiredAction to perform (e.g. navigate, click, data, loop)
objectTypeSelectorType|stringSelectorType::TagSelector type (css, xpath, id, text, etc.)
objectmixednullTarget element selector or payload
valuemixednullValue to fill/type or option argument
key?stringnullKey name for storing extracted data in results
wait?intnullTimeout wait in milliseconds after step execution
ignoreErrorboolfalseWhether to ignore errors during step execution
terminateOnErrorboolfalseHalt workflow execution immediately if step fails
subSteps?arraynullNested child steps (used by loop action)
callback?callablenullCustom PHP closure executed when action is custom

Lablnet\StepWright\DTOs\TabTemplate ​

Represents execution logic for a single browser tab.

php
new TabTemplate(
    string $tab,
    array $steps,
    ?PaginationConfig $pagination = null
)

Lablnet\StepWright\DTOs\PaginationConfig ​

php
new PaginationConfig(
    ?NextButtonConfig $nextButton = null,
    ?int $maxPages = null,
    bool $paginationFirst = false,
    bool $scrollBefore = false,
    bool $scrollAfter = false,
    ?int $scrollTimeout = null
)

Lablnet\StepWright\DTOs\NextButtonConfig ​

php
new NextButtonConfig(
    SelectorType|string $objectType = SelectorType::Tag,
    string $object = '',
    ?int $wait = null
)

Released under the MIT License.