AngleSharp by AngleSharp

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

.NET API 1,230,848 bytes

 IDocument

The Document interface serves as an entry point to the web page's content.

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

Gets a list of all elements in the document.

Gets a list of all of the anchors in the document.

IHtmlElement Body { get; set; }

Gets the body element.

string CharacterSet { get; }

Gets the character encoding of the current document.

Gets a list of the commands (menu item, button, and link elements) within the current document.

string CompatMode { get; }

Gets a value to indicate whether the document is rendered in Quirks mode (BackComp) or Strict mode (CSS1Compat).

string ContentType { get; }

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

Gets the browsing context to use.

string Cookie { get; set; }

Gets or sets the document cookie.

Gets the script element which is currently being processed.

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

string DesignMode { get; set; }

Gets or sets whether the entire document is editable.

string Direction { get; set; }

Gets or sets the value of the dir attribute.

Gets the document type.

Gets the root element of the document.

string DocumentUri { get; }

Gets the URI of the current document.

string Domain { get; set; }

Gets or sets the domain portion of the origin of the current document.

Gets the forms in the document.

Gets or sets the head element.

Gets the images in the document.

Gets the DOM implementation associated with the current document.

Gets the import ancestor, if any.

string LastModified { get; }

Gets the date of the last modification.

Gets a collection of all area and anchor elements in a document with a value for the href attribute.

Gets the current location of the document.

string Origin { get; }

Gets the Unicode serialization of document's origin.

Gets a list of the embed elements within the current document.

Gets the current ready state of the document.

string Referrer { get; }

Gets the referer to that pointed to the current document.

Gets the scripts in the document.

TextSource Source { get; }

Gets the underlying source.

Gets the status code of the server's response, if any.

string Title { get; set; }

Gets or sets the title of the document.

string Url { get; }

Gets a string containing the URL of the current document.

Event triggered after the ready state changed.

INode Adopt(INode externalNode)

Adopts a node from an external document. The node and its subtree is removed from the document it's in (if any), and its ownerDocument is changed to the current document. The node can then be inserted into the current document. The new node's parentNode is null, since it has not yet been inserted into the document tree.

void Close()

Finishes writing to a document.

IAttr CreateAttribute(string name)

Creates an Attr of the given name.

IAttr CreateAttribute(string namespaceUri, string name)

Creates an attribute of the given qualified name and namespace URI.

IComment CreateComment(string data)

Creates a new comment node, and returns it.

Creates an empty DocumentFragment object.

IElement CreateElement(string name)

Creates a new element with the given tag name.

IElement CreateElement(string namespaceUri, string name)

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

Event CreateEvent(string type)

Creates an event of the type specified.

INodeIterator CreateNodeIterator(INode root, FilterSettings settings = 4294967295, NodeFilter filter = null)

Creates a new NodeIterator object.

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

Creates a new Range object.

IText CreateTextNode(string data)

Creates a new text node and returns it.

ITreeWalker CreateTreeWalker(INode root, FilterSettings settings = 4294967295, NodeFilter filter = null)

Creates a new TreeWalker object.

bool ExecuteCommand(string commandId, bool showUserInterface = false, string value = "")

Executes a command with the provided id and the optional arguments.

string GetCommandValue(string commandId)

Gets the value of the document, range, or current selection, for the provided command.

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

Returns a list of elements with a given name in the HTML document.

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

IHtmlCollection<IElement> GetElementsByTagName(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.

bool HasFocus()

Checks if the document is currently focused.

INode Import(INode externalNode, bool deep = true)

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

bool IsCommandEnabled(string commandId)

Checks if the command with the provided id is enabled.

bool IsCommandExecuted(string commandId)

Checks if the command with the provided id has already been executed for the current value.

bool IsCommandIndeterminate(string commandId)

Checks if the command with the provided id is currently in an indeterminate state.

bool IsCommandSupported(string commandId)

Checks if a command with the provided id exists and is supported in the current context.

void Load(string url)

Loads the document content from the given url.

IDocument Open(string type = "text/html", string replace = null)

Causes the Document to be replaced in-place, as if it was a new Document object, but reusing the previous object, which is then returned.

void Write(string content)

Writes text to a document.

void WriteLine(string content)

Writes a line of text to a document.