Esempio n. 1
0
        private void _winWinScrapeThenSaveStore(bool isNew = false, bool needScrape = true)
        {
            _log($"Start WinWinScrapeThenSaveStore (isNew={isNew})");

            var state = new ScraperWinWinStateModel()
            {
                IsNew = isNew,
            };

            var scraper = new ScraperWinWin(state);

            if (needScrape)
            {
                scraper.Scrape();
            }

            var dataOfScrape = scraper.GetDomainModel();

            var excelService = new ExcelWinWinService(state);

            var excelData = excelService.CreateExcel(dataOfScrape);

            var pathToFile = excelService.SaveToFile(excelData);

            var archive = new ArchiveRepository();

            archive.Save(pathToFile, state.TypeScraper);

            _log($"End WinWinScrapeThenSaveStore (isNew={isNew}), Spent time {_calcSpentTime2String(state)}");
        }
Esempio n. 2
0
 static void Scrape(ScraperWinWin scraper)
 {
     var isOk = scraper.Scrape();
 }