PlatformReader

class PlatformReader(session: PageSession, scriptEngine: PlatformScriptEngine, config: BrowserConfig)

Handles DOM reading, element queries, and selector waiting on the platform backend.

Constructors

Link copied to clipboard
constructor(session: PageSession, scriptEngine: PlatformScriptEngine, config: BrowserConfig)

Functions

Link copied to clipboard
suspend fun content(): String

Reads the outer HTML of the document element, capped to prevent OOM.

Link copied to clipboard
suspend fun querySelector(selector: String): Element?

Queries the first element matching selector.

Link copied to clipboard
suspend fun querySelectorAll(selector: String): List<Element>

Queries all elements matching selector.

Link copied to clipboard
suspend fun text(): String

Reads the inner text of the document body, capped to prevent OOM.

Link copied to clipboard
suspend fun title(): String

Reads the current document title.

Link copied to clipboard
suspend fun waitForSelector(selector: String, timeoutMillis: Long = 0): Element

Waits until an element matching selector appears in the DOM.