Beispiel #1
0
        public List <ToxyNode> SelectNodes(string selector)
        {
            HtmlAgilityPack.HtmlNodeCollection htmlNodeList = this.HtmlNode.SelectNodes(selector);
            if (htmlNodeList == null)
            {
                return(null);
            }

            List <ToxyNode> toxyNodeList = new List <ToxyNode>();

            foreach (var item in htmlNodeList)
            {
                //todo:need to copy ChildNodes to the seleted node
                toxyNodeList.Add(ToxyNode.TransformHtmlNodeToToxyNode(item));
            }
            return(toxyNodeList);
        }
Beispiel #2
0
 public ToxyNode SingleSelect(string selector)
 {
     //todo:need to copy ChildNodes to the seleted node
     return(ToxyNode.TransformHtmlNodeToToxyNode(this.HtmlNode.SelectSingleNode(selector)));
 }