Element Lookup & Evaluation

Query Selector

Find an element using a CSS selector.

Find an element using a CSS selector.

Searches for the first DOM element matching the provided CSS selector within the configured search root. If found, returns the element data; if no match exists, returns an empty result.

TIP

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

Examples

MagicHelper: MagicHelper utility library

GPAL.MagicHelper.QuerySelector(string css);

Puppeteer Client: Puppeteer-style C# client

browser.PuppeteerClient.QuerySelector(string css).Execute<GPALElement>();

Puppeteer Communicator: Low-level communicator

await browser.PuppeteerCommunicator.QuerySelector(string css, string sessionId);

REST Client: Direct REST/HTTP client

GPAL.OttoMagicClient.WithEndpoint(ApiEndpoint.QuerySelector).WithCss(string css).Execute();