Navigation

Get DOM Attributes

Returns a specified element's DOM attributes.

Returns a specified element's DOM attributes.

Extracts all DOM attributes from the element and returns them as a key-value object, including only attributes that have both a valid name and value.

Examples

GPAL Fluent: High-level fluent C# API

var domAttributes = gPalElement.DomAttributes()

MagicHelper: MagicHelper utility library

GPAL.MagicHelper.GetDomAttribute(string css); GPAL.MagicHelper.GetDomAttribute(string xpath);

Puppeteer Client: Puppeteer-style C# client

browser.PuppeteerClient.GetDomAttributes(string css).Execute(); browser.PuppeteerClient.GetDomAttributes(string xpath).Execute();

Puppeteer Communicator: Low-level communicator

await browser.PuppeteerCommunicator.GetDomAttributes(string selector, string sessionId);

REST Client: Direct REST/HTTP client

GPAL.OttoMagicClient.WithEndpoint(ApiEndpoint.GetDomAttributes).WithCss(string css).Execute(); GPAL.OttoMagicClient.WithEndpoint(ApiEndpoint.GetDomAttributes).WithXPath(string xpath).Execute();