Ejemplo n.º 1
0
        private void _homeLessScrapeThenSaveStore(bool isNew = false, bool needScrape = true)
        {
            _log($"Start HomeLessScrapeThenSaveStore (isNew={isNew})");

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

            var scraper = new ScraperHomeLess(state);

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

            var dataOfScrape = scraper.GetDomainModel();

            var excelService = new ExcelHomeLessService(state);

            var excelData = excelService.CreateExcel(dataOfScrape);

            var pathToFile = excelService.SaveToFile(excelData);

            var archive = new ArchiveRepository();

            archive.Save(pathToFile, state.TypeScraper);

            _log($"End HomeLessScrapeThenSaveStore (isNew={isNew}), Spent time {_calcSpentTime2String(state)}");
        }
Ejemplo n.º 2
0
 static void Scrape(ScraperHomeLess scraper)
 {
     var isOk = scraper.Scrape();
 }