Пример #1
0
        private static string ArbitrTable(string name, ArbitrStat info)
        {
            string html = "";

            if (info != null)
            {
                html += string.Format(PB + @"
<h3 class='h3class'> Арбитражные дела в качестве {2}</h3><span  style='font-size:13px;'> Всего (<span class='silversmall'>{0}</span>) Общая сумма (<span class='silversmall'>{1}</span>)<span>
<br>
<br>
<ol>", info.Count, info.Sum, name);

                foreach (var _case in info.Cases)
                {
                    html += string.Format("<li>{0}</li><br>", _case.Number);
                }
                html += "</ol>";
            }
            return(html);
        }
Пример #2
0
        public static ArbitrStat ArbitrAsThird(string html)
        {
            HtmlDocument doc = new HtmlDocument();

            doc.LoadHtml(html);

            ArbitrStat stat = new ArbitrStat();

            var countEl = doc.DocumentNode.SelectSingleNode("/html/body/div[1]/div[5]/div/div[2]/div/ul/li[3]/span");
            var match   = Regex.Match(countEl.InnerText.GetHTMLDecoded(), @"Другое \((?<count>[0-9]*)\)");

            stat.Count = int.Parse(match.Groups["count"].Value);

            var sumEl = doc.DocumentNode.SelectSingleNode("/html/body/div[1]/div[5]/div/div[2]/div/ul/li[3]/span/i");

            stat.Sum = sumEl != null?sumEl.InnerText.GetHTMLDecoded() : "";

            stat.Cases = ParseArbitrCases(doc);
            if (stat.Cases == null)
            {
                return(null);
            }
            return(stat);
        }