|
|
Posted on 8/4/2016 5:05:36 PM
|
|
|
|

Download Address:
http://htmlagilitypack.codeplex.com/
IEnumerable<HtmlNode> Ancestors(); Returns a collection of all parent nodes of this element. IEnumerable<HtmlNode> Ancestors(string name); Returns a collection of all parent nodes whose parameter names match this element. IEnumerable<HtmlNode> AncestorsAndSelf(); Returns all parent nodes and its own collection of this element. IEnumerable<HtmlNode> AncestorsAndSelf(string name); Returns a collection of all parent nodes and itself that match the name of this element. HtmlNode AppendChild(HtmlNode newChild); Appends a parameter element to a child element that is calling the element (appended at the end) void AppendChildren(HtmlNodeCollection newChildren); Appends elements in the parameter collection as children of the calling element (appended at the end) HtmlNode PrependChild(HtmlNode newChild); Place the element in the argument as a child element at the top of the calling element void PrependChildren(HtmlNodeCollection newChildren); Place all elements in the parameter set as child elements, before the calling element static bool CanOverlapElement(string name); Determine if duplicate elements can be saved IEnumerable<HtmlAttribute> ChildAttributes(string name); Get the attributes of all child elements (parameter names should match the element names) HtmlNode Clone(); This node is cloned to a new node HtmlNode CloneNode(bool deep); The node is cloned to a new point, and the parameters determine whether to clone the child elements together HtmlNode CloneNode(string newName); Change the element name while cloning HtmlNode CloneNode(string newName, bool deep); Change the element name while cloning. parameter to determine whether to clone together with the child elements void CopyFrom(HtmlNode node); Create duplicate nodes and subtrees under them. void CopyFrom(HtmlNode node, bool deep); Create a copy of the node. XPathNavigator CreateNavigator(); One returned for this document for XPathNavigator static HtmlNode CreateNode(string html); Static method that allows creating a new node with a string XPathNavigator CreateRootNavigator(); Create an XPathNavigator for the root path IEnumerable<HtmlNode> DescendantNodes(); Get all child nodes IEnumerable<HtmlNode> DescendantNodesAndSelf(); Get all the child nodes and yourself IEnumerable<HtmlNode> Descendants(); Get all the child nodes in the enumeration list IEnumerable<HtmlNode> Descendants(string name); Get all the child nodes in the enumeration list, and note that the element names match the parameters IEnumerable<HtmlNode> DescendantsAndSelf(); Get all the child nodes in the enumeration list as well as themselves IEnumerable<HtmlNode> DescendantsAndSelf(string name); Get all the child nodes in the enumeration list and themselves, and pay attention to the element names to match the parameters HtmlNode Element(string name); Get an element based on the parameter name IEnumerable<HtmlNode> Elements(string name); Get a matching set of elements based on the parameter name bool GetAttributeValue(string name, bool def); A help method used to obtain the value of the property of this node (Boolean type). If the property is not found, the default value is returned. int GetAttributeValue(string name, int def); The help method is used to get the value (integer) of the attribute of this node. If the property is not found, the default value is returned. string GetAttributeValue(string name, string def); The help method is used to get the value (string type) of the property of this node. If the property is not found, the default value is returned. HtmlNode InsertAfter(HtmlNode newChild, HtmlNode refChild); Inserting a node behind the second parameter node is a sibling relationship with the second parameter HtmlNode InsertBefore(HtmlNode newChild, HtmlNode refChild); It is said that a node is inserted after the second parameter node, and the second parameter is a sibling relationship static bool IsCDataElement(string name); Determines whether an element node is a CDATA element node. static bool IsClosedElement(string name); Determines whether the element node is closed or not static bool IsEmptyElement(string name); Determines whether an empty element node is present. static bool IsOverlappedClosingElement(string text); Determining whether the text corresponds to a node can preserve overlapping end markers. void Remove(); Remove the calling node from the parent collection void RemoveAll(); Remove all child nodes and properties of the calling node void RemoveAllChildren(); Remove all child nodes of the calling node HtmlNode RemoveChild(HtmlNode oldChild); Remove the child node with the specified name of the calling node HtmlNode RemoveChild(HtmlNode oldChild, bool keepGrandChildren); Remove the child node of the calling node's call name, and the second parameter determines whether to remove it along with the grandchild node HtmlNode ReplaceChild(HtmlNode newChild, HtmlNode oldChild); Replace one of the original child nodes of the calling node with a new node, and the second parameter is the old node HtmlNodeCollection SelectNodes(string xpath); Get a collection of nodes based on XPath HtmlNode SelectSingleNode(string xpath); Get a unique node based on XPath HtmlAttribute SetAttributeValue(string name, string value); Set the properties of the calling node string WriteContentTo(); Save all the children of that node to a string. void WriteContentTo(TextWriter outText); Save all children of that node to the specified TextWriter. string WriteTo(); Save the current node to a string. void WriteTo(TextWriter outText); Save the current node to the specified TextWriter. void WriteTo(XmlWriter writer); Save the current node to the specified XmlWriter.
|
Previous:HtmlAgilityPack parses html5's xpath node with an errorNext:ASP.NET MVC modifies the Shared default path of the view (MVC2, MVC3)
|