DecodeHTML() public static method

Decodes the HTML-encoded sections of the supplied string
public static DecodeHTML ( string html ) : string
html string HTML-encoded string
return string
コード例 #1
0
        /// <summary>
        /// Extracts the product's name from a single product's html
        /// </summary>
        /// <param name="itemHtml">Single product result html</param>
        /// <returns>Name of product</returns>
        public static string GetProductName(string itemHtml)
        {
            string productNamePattern = @"(?<= title="").*?(?="" )";
            string match = GetSingleRegExMatch(itemHtml, productNamePattern);

            if (match.Length == 0)
            {
                return(null);
            }

            string productName = Scraper.DecodeHTML(match);

            return(productName);
        }