Element Info & Attributes

Get Shadow Root

Returns a GPALElement of the element's parent in JSON format including attributes, geometry, visibility state, identifiers, multiple locator strategies (XPath and CSS), and key properties such as text, value, and source URLs. The function enriches the element with positional data, bounding box metrics, and alternative selectors for robust identification, then returns the serialized result as a JSON string.

NOTE

CSSAttributes, DOMAttributes and DomProperties are lazy loaded on first usage.

Examples

GPAL Fluent: High-level fluent C# API

//Carried on the element itself once it has been found, so nothing is asked of the browser to read it.

GPALElement shadow = gPalElement.ShadowRoot;

MagicHelper: MagicHelper utility library

browser.MagicHelper.GetShadowRoot("#shadow-host");

Puppeteer Client: Puppeteer-style C# client

browser.PuppeteerClient.GetShadowRoot("#shadow-host").Execute<GPALElement>();

Puppeteer Communicator: Low-level communicator

await browser.PuppeteerCommunicator.GetShadowRoot("#shadow-host");

REST Client: Direct REST/HTTP client

browser.OttoMagicClient.GetShadowRoot("#shadow-host").Execute<GPALElement>();

💬 Ask GPAL