GetElementWithAttribute() public method

public GetElementWithAttribute ( HtmlNode root, string elementName, string attributeName, string attributeValue ) : HtmlNode
root HtmlAgilityPack.HtmlNode
elementName string
attributeName string
attributeValue string
return HtmlAgilityPack.HtmlNode
示例#1
0
        private string GetArtistName(HtmlNode body)
        {
            var headerNode = helper.GetElementWithAttribute(body, "h1", "class", "header");
            var movieName  = helper.GetElementWithAttribute(headerNode, "span", "class", "itemprop");

            return((movieName == null) ? string.Empty : movieName.InnerText);
        }
示例#2
0
        private HtmlAgilityPack.HtmlNode GetSongNodeList(HtmlAgilityPack.HtmlNode body)
        {
            var contentNode = helper.GetElementWithAttribute(body, "div", "class", "section");

            //var songList = contentNode.ChildNodes;// helper.GetElementWithAttribute(contentNode, "p", "class", "row");
            return(contentNode);
            //var song = helper.GetElementWithAttribute(songList, "li", "class", "song-wrap");
            //return helper.GetElementWithAttribute(song, "span", "class", "main");
        }