コード例 #1
0
        public static string TryGetNodeInnerText(HtmlNode node, bool ignoreBlank, bool needTrim, string prefix, string postfix)
        {
            string value = node == null ? null : CommonUtil.HtmlDecode(needTrim ? node.InnerText.Trim() : node.InnerText);

            return(((value == null || value.Length == 0) && ignoreBlank) ? null : (prefix + value + postfix));
        }
コード例 #2
0
        public static string TryGetNodeInnerText(HtmlNode parentNode, string xPath, bool needTrim)
        {
            HtmlNode node = parentNode.SelectSingleNode(xPath);

            return(node == null ? null : CommonUtil.HtmlDecode(needTrim ? node.InnerText.Trim() : node.InnerText));
        }