Beispiel #1
0
        // Player_W 정보 얻기
        public List <Player_W> GetPlayer_W(String teamName)
        {
            try
            {
                InitCromeDriver();
                String teamInitial = Util.Util.GetTeamInitialFromName(teamName);

                if (teamName.ToUpper() == "KT")
                {
                    teamName = "kt";
                }
                List <Player_W> players = new List <Player_W>();
                for (Int32 i = 1; i < 7; ++i)
                {
                    try
                    {
                        CrawlerPlayer_W crawler = new CrawlerPlayer_W(chromeDriver);
                        crawler.Init(teamName, i);
                        String html = crawler.GetHTML();
                        if (html != null)
                        {
                            List <Player_W> ps = Parser.ParserPlayer_W.Instance.Parse(html, teamInitial);
                            players = players.Concat(ps).ToList();
                        }
                    }
                    catch
                    {
                        i--;
                        continue;
                    }
                }
                return(players);
            }
            finally
            {
                DisposeDriver();
            }
        }
Beispiel #2
0
 // Player_W 정보 얻기
 public List<Player_W> GetPlayer_W(String teamName)
 {
     try
     {
         InitCromeDriver();
         String teamInitial = Util.Util.GetTeamInitialFromName(teamName);
         
         if(teamName.ToUpper() == "KT")
         {
             teamName = "kt";
         }
         List<Player_W> players = new List<Player_W>();
         for (Int32 i = 1; i < 7; ++i)
         {
             try
             {
                 CrawlerPlayer_W crawler = new CrawlerPlayer_W(chromeDriver);
                 crawler.Init(teamName, i);
                 String html = crawler.GetHTML();
                 if (html != null)
                 {
                     List<Player_W> ps = Parser.ParserPlayer_W.Instance.Parse(html, teamInitial);
                     players = players.Concat(ps).ToList();
                 }
             }
             catch
             {
                 i--;
                 continue;
             }
         }
         return players;
     }
     finally
     {
         DisposeDriver();
     }
 }