Docs

RunMacro Documentation

Create your first robot, then go further as needed.

Clear step-by-step guides to create, run, and improve robots for repetitive computer work.

Docs Keyboard CDP Copy Text (Background)
📋 Keyboard

Grab text from a web page in background Chrome (CDP)

The CDP Copy Text command reads text from a web page in Browser Mode (CDP) and stores it in the virtual clipboard or a variable.

Prerequisites#

  • The workflow runs in Browser Mode with an active CDP driver.
  • Selector source has a valid CSS selector; selection or focused-input source has matching page state.
  • The result variable name is valid when storage beyond the virtual clipboard is needed.

Supported modes#

  • Browser Mode — Always writes text to the context virtual clipboard and additionally to a variable when configured.

What it does#

The CDP Copy Text command reads text from a web page in Browser Mode (CDP) and stores it in the virtual clipboard or a variable. The source can be: the current selection, a specific selector, or the focused input. It does not use the real Windows clipboard, so it does not disturb other work.

Screenshots & video#

RunMacro CDP Copy Text (Background) command configuration dialog showing parameter fields
Configuration dialog and parameter fields for the CDP Copy Text (Background) command in RunMacro.

When to use it#

  • Grab a web element content (price, code, status) to process.
  • Read data in the background without touching the real clipboard.
  • Save text into a variable for a later step.

When not to use it#

  • The workflow runs only in Desktop Mode.
  • Structured extraction or complex iframe/shadow-DOM handling is required; Smart HTML is more appropriate.
  • The selector is unstable or the target is outside the current CDP page context.

Configuration steps#

  1. In Browser Mode (CDP), add Keyboard › CDP Copy Text.
  2. Choose the source: selection / selector / focused input.
  3. For selector, enter the selector; set a result variable if needed. Save.

Every option explained#

Source (selection / selector / focused input)#

Where to read text: the selection, an element by selector, or the focused input.

Selector#

The CSS selector of the element to read (when source = selector).

Result variable#

The variable name to store the text. Leave empty to store only in the virtual clipboard.

Expected result#

Text from the selection, selector, or focused input is written to the virtual clipboard and optionally to the result variable.

Real example#

Example: grab a product price#

  1. CDP Copy Text: source = selector .price, variable = price.
  2. Use {price} in later steps.

Limitations and failure cases#

  • The command fails outside Browser Mode or without a CDP driver.
  • A missing selector or empty selection can produce an empty string.
  • Iframes, shadow DOM, cross-origin content, or dynamically replaced elements may require different targeting.

Tips & common mistakes#

Runs only in Browser Mode (CDP). This is the background version of Copy Text — use it to grab web data without taking the clipboard/mouse.

Verification details#

  • commands/cdp_clipboard.py
RunMacro robot

Robots do the work. Your time is yours.

Create a robot in minutes, no coding needed. Reliable execution, remote management, transparent costs — and you always stay in control.