Skip to content

Built-in Actions Reference

webGrabber provides a comprehensive suite of built-in actions designed to rapidly piece together complex scraping or automation workflows. Actions are categorized by their primary domain of responsibility.


💾 Variables & Memory

Manage the internal state of the current grab run. Use these actions to store, increment, or extract data payloads dynamically.

ActionParametersDescription
setVariablekey (str), value (str)Statically bind a key-value pair into the memory buffer. Can be interpolated later via {{key}}.
getVariablekey (str), index (str)Fetches an exact key. Automatically populates the global INPUT pipe. Use index to slice array values.
appendToVariablekey (str), value (str)String concatenation. Appends the value to the existing memory key.
deleteVariablekey (str)Hard deletes the specified key from the running memory pool.
transferVariablefrom (str), to (str)Safely clones the value mapping from one memory key directly into another target binding.
countStartkey (str), value (str)Initializes a numerical counter integer under the specified key. Defaults to 0 if no value explicitly given.
countIncrementkey (str)Increments the numerical counter corresponding to key by 1.
countDecrementkey (str)Decrements the numerical counter corresponding to key by 1.

🖱️ Interaction & Input

Drive the headless browser directly using Puppeteer's underlying API to simulate natural human inputs.

ActionParametersDescription
typeselector (str), text (str), secret (str)Focuses on an input node and types exactly the provided text. Masks logs if secret is true.
clickselector (str), text (str)Fires a mouse click sequence. Can optionally fuzzy match button values if text is provided.
clickAllselector (str)Finds an array of DOM nodes matching the selector and dispatches a concurrent click on all.
loginurl, usernameSelector, username, passwordSelector, password, submitSelector, cookieName (opt)High-level macro. Bootstraps a full login sequence targeting specific fields and clicks submit. Auto-saves session cookies to disk. Providing cookieName (the specific string key of your auth cookie, e.g., 'jwt_token') allows the engine to isolate the correct cookie and check its expiry timestamp. If valid, it natively restores the session and skips the login form.
scrollWaitClickselector (str), ms (str)Forces the viewport to scroll until the selector intersects the screen, waits ms, then clicks.

🌐 Browser Manipulation

Manage window frames, navigation history, evaluating DOM queries, and screenshots.

ActionParametersDescription
puppeteerfunc (str)The most versatile bridging action. Dispatches a raw string function literal onto the Puppeteer Page object. Examples: goto, reload.
newPagepageKey (str)Spins up a new browser tab/frame instance and records the handle inside the engine registry under pageKey.
switchPagepageKey (str)Rotates the execution scope and viewport focus cleanly onto the specified pageKey identifier.
closePagepageKey (str)Safely terminates and garbage collects the specific tab mapping.
screenshotname (str), fullPage (bool)Dumps a .png snapshot mapping to the viewport buffer. Defaults to the visible boundaries unless fullPage is true.
screenshotElementname (str), selector (str)Dumps a highly focused .png snapshot specifically bounded merely to the matched element coordinates.
getElementsselector (str), attribute (str)Evaluates querySelectorAll. Maps returning values cleanly into the global INPUT pipe for extraction.
elementExistsselector (str)Performs a non-blocking fast DOM check assessing if the matching node is currently painted on DOM.

📂 Filesystem Orchestration

Interact intelligently with the local host disk. Store payloads, read text dumps, or manage staging folders dynamically via automation.

ActionParametersDescription
createDirdir (str)Instantiates a new arbitrary system directory path mapping.
createFilefilename (str), content (str)Generates a new utf-8 file block instantly dumping the stringified content.
listFoldersNoneMaps a tree listing of the actively executing directory root, outputting directly to INPUT.
fileExistsfilename (str)Verifies if the fully qualified target filename is resolvable on disk geometry.
downloadurl (str), filename (str)Stream-downloads the binary signature from the targeting absolute url payload directly into an offline file payload.
saveToTextkey (str), filename (str)Retrieves the active value nested in memory context (key) and strictly binds the entire string directly onto disk format (filename).
readFromTextfilename (str)Maps the entire utf-8 contents of a strictly defined local directory file block, cleanly emitting back directly to INPUT.

🔀 Control Flow

Conditionally route the declarative grab arrays. Loops and logical branch evaluations dynamically execute action shards seamlessly.

ActionParametersDescription
ifcondition (str), actions (str)Evaluates a plain JS-compatible string literal boolean condition. If truthy, deeply processes the injected sub-array.
ifElsecondition (str), actions (str)Same evaluation loop hook, providing an explicit fall-back elseActions array sequence routing block payload.
whilecondition (str), actions (str)Traverses indefinitely processing the nested sub-array payload blocks recursively as long as the memory boundary mapping holds true.
forfrom (int), until (int)Steps iteratively between integer from constraints.
forEachkey (str), actions (str)Highly practical mapping iteration block strictly bounded directly against a target object layout bound into memory contextualized key.

🛠️ Utilities

Standard logic bridging modules and formatting normalizers bridging raw values into sanitized text pipelines.

ActionParametersDescription
logmessage (str), color (str)Outputs an environment logger message block mapping. Safely evaluates global {{}} interpolation string signatures natively.
sleepms (int)Forcibly hooks into a Promise setTimeout pause interval, unconditionally freezing execution routines indefinitely matching ms.
randommin (int), max (int)Maps a randomized safe float execution scalar mapping string matching boundaries, storing perfectly directly to INPUT.
matchFromStringstring (str), regex (str)A robust generic string RegExp executer sequence mapped directly over the injected targeted string.
replaceStringstring (str)Finds and forcibly overwrites specific sub-string signature payloads matching dynamic criteria blocks perfectly.

To implement workflows not covered organically here, read the guide on declaring custom behaviors over Custom Actions.