Ejemplo n.º 1
0
        // Player정보 얻기
        public DbItemBase GetPlayer(Player_W player_W)
        {
            Int32 errorCount = 0;

            while (true)
            {
                try
                {
                    chromeDriver = InitCromeDriver();
                    CrawlerPlayer crawler = new CrawlerPlayer(chromeDriver);
                    crawler.Init(player_W.Href);
                    String     html     = crawler.GetHTML();
                    String[]   items    = player_W.Href.Split(new String[] { "=" }, StringSplitOptions.RemoveEmptyEntries);
                    Int32      playerId = Convert.ToInt32(items[items.Length - 1]);
                    DbItemBase player   = ParserPlayer.Instance.Parse(html, player_W.Team, playerId);
                    return(player);
                }
                catch (Exception e)
                {
                    errorCount++;
                    if (errorCount > 5)
                    {
                        throw e;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        // Player 정보 얻기
        public Player GetPlayer(Player_W player_W)
        {
            InitCromeDriver();
            CrawlerPlayer crawler = new CrawlerPlayer(chromeDriver);
            crawler.Init(player_W.Href);

            String html = crawler.GetHTML();

            String[] items = player_W.Href.Split(new String[] { "=" }, StringSplitOptions.RemoveEmptyEntries);
            Int32 playerId = Convert.ToInt32(items[items.Length - 1]);
            var player = BeThe.Parse.Manager.Instance.ParsePlayer(html, player_W.Team, playerId);
            return player;
        }