AngleSharp by Florian Rappl

<PackageReference Include="AngleSharp" Version="0.8.0" />

.NET API 1,171,968 bytes

 Element

Represents an element node.
protected sealed class BoundLocation : ILocation, IUrlUtilities

Represents an updateable location (url) holder.

public int ChildElementCount { get; }

Gets the number of child elements.

public IHtmlCollection Children { get; }

Gets the child elements.

public ITokenList ClassList { get; }

Gets the list of class names.

public string ClassName { get; set; }

Gets or sets the value of the class attribute.

public IElement FirstElementChild { get; }

Gets the first child element of this element.

public string Id { get; set; }

Gets or sets the value of the id attribute.

public string InnerHtml { get; set; }

Gets or sets the HTML syntax describing the element's descendants.

public bool IsFocused { get; protected set; }

Gets if the element is currently focused.

public IElement LastElementChild { get; }

Gets the last child element of this element.

public string LocalName { get; }

Gets the local part of the qualified name of this node.

public string NamespaceUri { get; }

Gets the namespace URI of this node.

public IElement NextElementSibling { get; }

Gets the element immediately following in this node's parent's list of nodes, or null if the current element is the last element in that list.

public string OuterHtml { get; set; }

Gets or sets the HTML syntax describing the element including its descendants.

public string Prefix { get; }

Gets or sets the namespace prefix of the specified node, or null if no prefix is specified.

Gets the element immediately preceding in this node's parent's list of nodes, null if the current element is the first element in that list.

public string TagName { get; }

Gets the tagname of the element.

public Element(Document owner, string name, NodeFlags flags = 0)

Creates a new element node.

protected static void CopyAttributes(Element source, Element target)

Copies the attributes from the source element to the target element. Each attribute will be recreated on the target.

public void After(INode[] nodes)

Inserts nodes after the current node.

public void Append(INode[] nodes)

Appends nodes to current node.

public void Before(INode[] nodes)

Inserts nodes before the current node.

public string GetAttribute(string name)

Returns the value of the named attribute on the specified element.

public string GetAttribute(string namespaceUri, string localName)

Returns the value of the named attribute on the specified element.

public IHtmlCollection GetElementsByClassName(string classNames)

Returns a set of elements which have all the given class names.

public IHtmlCollection GetElementsByTagName(string tagName)

Returns a NodeList of elements with the given tag name. The complete document is searched, including the root node.

public IHtmlCollection GetElementsByTagNameNS(string namespaceURI, string tagName)

Returns a list of elements with the given tag name belonging to the given namespace. The complete document is searched, including the root node.

public bool HasAttribute(string name)

Returns a boolean value indicating whether the specified element has the specified attribute or not.

public bool HasAttribute(string namespaceUri, string localName)

Returns a boolean value indicating whether the specified element has the specified attribute or not.

public void Insert(AdjacentPosition position, string html)

Inserts new HTML elements specified by the given HTML string at a position relative to the current element specified by the position.

public bool Matches(string selectors)

Checks if the element is matched by the given selector.

public void Prepend(INode[] nodes)

Prepends nodes to the current node.

public IPseudoElement Pseudo(string pseudoElement)

Creates a pseudo element for the current element.

public IElement QuerySelector(string selectors)

Returns the first element within the document (using depth-first pre-order traversal of the document's nodes) that matches the specified group of selectors.

public IHtmlCollection QuerySelectorAll(string selectors)

Returns a list of the elements within the document (using depth-first pre-order traversal of the document's nodes) that match the specified group of selectors.

protected void RegisterAttributeObserver(string name, Action<string> callback)

Registers an observer for attribute events.

public void Remove()

Removes the current element from the parent.

public void RemoveAttribute(string name)

Removes an attribute from the specified element.

public void RemoveAttribute(string namespaceUri, string localName)

Removes an attribute from the specified element.

public void Replace(INode[] nodes)

Replaces the current node with the nodes.

public void SetAttribute(string name, string value)

Adds a new attribute or changes the value of an existing attribute on the specified element.

public void SetAttribute(string namespaceUri, string name, string value)

Adds a new attribute or changes the value of an existing attribute on the specified element.

protected void UpdateAttribute(string name, string value)

Updates an attribute's value without notifying the observers.