GREAT LOTUS PYAUTO WEB icon

GREAT LOTUS PYAUTO WEB

10 action groups: ManagerAction, MouseAction, KeyboardAction, BrowserControl, ElementAction, ImageAction, OthersAction, EmailAction, DeveloperAction, General Debug

9. Developer → count_element

AI-generated

Summary

Publishes an MQTT request to count elements matching a target selector or XPath in a browser session. Provide the required topic and remote port, then optionally set a target and/or XPath; configure input item forwarding, response waiting, timeout, QoS, and delay as needed.

Inputs

  • Topic (required) — MQTT topic used to route the request to a client.
  • Remote Port (required) — CDP port used to route the command to the intended worker session; use the upstream profile node’s remote_port, or 127001 for a local session.
  • Target — Optional selector for the elements to count. Supports prefixes such as css=, id=, and text=.
  • XPath — Optional XPath for the elements to count.
  • QoS — MQTT delivery quality level, defaulting to 1 (at least once).
  • Include Input Items — When enabled, attaches selected fields from incoming items to payload.inputItems.
  • Include Input Fields — Comma-separated field paths to forward when input item inclusion is enabled; supports nested paths and array indexes.
  • Wait For Response — When enabled, waits for an MQTT response before returning; defaults to false.
  • Response Timeout (sec) — Maximum response wait when waiting is enabled; defaults to 60 seconds.
  • Delay Next Step (ms) — Delay before continuing after publish, or after receiving the response when response waiting is enabled. Defaults to rand(200,1000).

Output shape

A single output item containing the MQTT response when waiting is enabled; otherwise the operation publishes the request and continues without waiting for a response.

The properties identify the action as equivalent to Element → count_element and describe it as counting elements matched by selector/XPath. The exact response fields and count representation are not shown in the provided source view.

Links

Discussion