예제 #1
0
        override public string StatsCollector(string m_StatsUrl)
        {
            try
            {
                HtmlWeb      web1 = new HtmlWeb();
                HtmlDocument doc1 = web1.Load(m_StatsUrl);
                doc1.DocumentNode.Descendants().Where(n => n.Name == "script").ToList().ForEach(n => n.Remove());

                HtmlNodeCollection nodesTeamNames1 = doc1.DocumentNode.SelectNodes($"//p[@class='{"text-center"}']");
                HtmlNodeCollection nodesTeamNames2 = doc1.DocumentNode.SelectNodes($"//div[@class='{"size-s graphics-text-primary-color"}']");

                if (nodesTeamNames1[2].InnerText != "0")
                {
                    return(UI.ArrangeHebStringToBeHebUICustomize(" נגמרו בתיקו.") + nodesTeamNames2[0].InnerText[0] + UI.ArrangeHebStringToBeHebUICustomize(" משחקים, מתוכם ") + nodesTeamNames1[2].InnerText + UI.ArrangeHebStringToBeHebUICustomize(" הקבוצות שיחקו ") + Environment.NewLine);
                }
                else
                {
                    return(" ");
                }
            }
            catch (NullReferenceException nre)
            {
                return(" ");
            }
            catch (Exception e)
            {
                //Console.WriteLine("an Error Ocuured When Trying To Connect to: " + m_StatsUrl + Environment.NewLine + e.Message);
                return(" ");
            }
        }