Navigation

Get Content and CSS

Export element as standalone HTML.

Export element as standalone HTML.

Builds a self-contained HTML document from the selected element by combining its outer HTML with extracted global and element-specific CSS inside a <style> block, then returns the complete HTML string.

Examples

MagicHelper: MagicHelper utility library

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

Puppeteer Client: Puppeteer-style C# client

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

Puppeteer Communicator: Low-level communicator

await browser.PuppeteerCommunicator.GetContentAndCss(string elementId, string sessionId);

REST Client: Direct REST/HTTP client

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