AngleSharp by Florian Rappl

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

 Document

Represents a document node.
protected string _contentType

The content type of the MIME type from the header.

The doctype element.

The root element.

protected string _location

The location of the document.

protected string _referrer

The original referrer to this document.

The list of contained stylesheets.

public Element ActiveElement { get; protected set; }

Gets the currently focused element, that is, the element that will get keystroke events if the user types any.

public bool Async { get; }

Gets an indicator if loading the document should be asynchronous or synchronous.

public string CharacterSet { get; set; }

Gets or sets the character encoding of the current document.

public string ContentType { get; }

Gets the Content-Type from the MIME Header of the current document.

public IWindow DefaultView { get; }

Gets the window object associated with the document or null if none available.

public DocumentType Doctype { get; }

Gets the document type.

public Element DocumentElement { get; }

Gets the root element of the document.

public string DocumentURI { get; }

Gets the URI of the current document.

Gets the DOMImplementation object that handles this document.

public string InputEncoding { get; }

Gets the encoding that was used when the document was parsed.

public DateTime LastModified { get; }

Gets a string containing the date and time on which the current document was last modified.

public Location Location { get; set; }

Gets or sets the URI of the current document.

public IWindow ParentWindow { get; }

Gets the parent window object if any.

public Readiness ReadyState { get; set; }

Gets or sets the ready state of the document.

public string Referrer { get; protected set; }

Gets the URI of the page that linked to this page.

public StyleSheetList StyleSheets { get; }

Gets a list of stylesheet objects for stylesheets explicitly linked into or embedded in a document.

public DOMStringList StyleSheetSets { get; }

Gets a live list of all of the currently-available style sheet sets.

This event is fired when the ready state of the document changes.

protected static void CopyDocumentProperties(Document source, Document target, bool deep)

Copies all (Document) properties of the source to the target.

protected static T FindChild<T>(Node parent) where T : Node

Tries to find a direct child of a certain type.

protected static Element GetElementById(NodeList children, string id)

Gets an element by its ID.

public Document Append(Node[] nodes)

Appends nodes to current document.

public Attr CreateAttribute(string name)

Creates a new attribute node, and returns it.

public Attr CreateAttributeNS(string namespaceURI, string name)

Creates a new attribute node with a namespace, and returns it.

public virtual CDATASection CreateCDATASection(string data)

Creates a new CDATA section node, and returns it.

public Comment CreateComment(string data)

Creates a new comment node, and returns it.

Creates an empty DocumentFragment object.

public virtual Element CreateElement(string tagName)

Creates a new element with the given tag name.

public Element CreateElementNS(string namespaceURI, string tagName)

Creates a new element with the given tag name and namespace URI.

Creates an EntityReference object. In addition, if the referenced entity is known, the child list of the EntityReference node is made the same as that of the corresponding Entity node.

public Event CreateEvent(string type)

Creates an event of the type specified. (NOT IMPLEMENTED YET)

public ProcessingInstruction CreateProcessingInstruction(string target, string data)

Creates a ProcessingInstruction node given the specified name and data strings.

public Range CreateRange()

Returns a new Range object. (NOT IMPLEMENTED YET)

public TextNode CreateTextNode(string data)

Creates a new Text node.

public Element GetElementById(string elementId)

Returns the Element whose ID is given by elementId. If no such element exists, returns null. The behavior is not defined if more than one element have this ID.

public HTMLCollection GetElementsByClassName(string classNames)

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

public HTMLCollection GetElementsByTagName(string tagName)

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

public HTMLCollection 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 Node ImportNode(Node externalNode, bool deep = true)

Creates a copy of a node from an external document that can be inserted into the current document.

public Document Prepend(Node[] nodes)

Prepends nodes to the current document.

public Element 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 HTMLCollection 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.