Exemplo n.º 1
0
        // Schedule 정보 얻기
        public List <DbItemBase> GetSchedule(Int32 year, Int32 month)
        {
            Int32 errorCount = 0;

            while (true)
            {
                try
                {
                    List <DbItemBase> schedules = new List <DbItemBase>();
                    chromeDriver = InitCromeDriver();
                    CrawlerSchedule crawler = new CrawlerSchedule(chromeDriver);
                    crawler.Init(year, month);
                    String html       = crawler.GetHTML();
                    var    tSchedules = ParserShedule.Instance.Parse(html, year, month);
                    schedules = schedules.Concat(tSchedules).ToList();
                    return(schedules);
                }
                catch (Exception e)
                {
                    errorCount++;
                    if (errorCount > 5)
                    {
                        throw e;
                    }
                }
            }
        }
Exemplo n.º 2
0
 // 스케줄 정보 얻기
 public List<Schedule> GetSchedule(Int32 year, Int32 month)
 {
     InitCromeDriver();
     CrawlerSchedule crawler = new CrawlerSchedule(chromeDriver);
     crawler.Init(year, month);
     String html = null;
     html = crawler.GetHTML();
     return BeThe.Parse.Manager.Instance.ParseSchedule(html, year, month);
 }