Пример #1
0
        static void Main(string[] args)
        {
            string path = @"..\..\..\..\ContentFolder";
            var    scd  = new SiteContentDownloader(path, 2, true);

            scd.FileExstention = new List <string> {
                ".jpg", ".gif", "pdf"
            };

            scd.LoadSite("https://www.google.com/");
            scd.LoadSite("https://www.yandex.kz/");
            scd.LoadSite("https://www.tiktok.com/");
            Console.Read();
        }
Пример #2
0
        static void Main(string[] args)
        {
            var saver        = new ContentSaver(@"..\..\..\..\Target Folder");
            var logger       = new ConsoleLogger();
            var maxDeepLevel = 2;
            var sd           = new SiteContentDownloader(saver, logger, maxDeepLevel, true);

            sd.FileExetention = new List <string> {
                ".jpg", ".png"
            };
            // вот эти вроде подгрузает без проблем))) не один сайт
            //sd.LoadFromURL("https://www.google.com/");
            //sd.LoadFromURL("https://stackoverflow.com//");
            //sd.LoadFromURL("https://www.reddit.com/");
            sd.LoadFromURL("https://docs.microsoft.com");



            Console.Read();
        }
Пример #3
0
        private SiteReview GetReview()
        {
            //Get the main page HTML and the time to download
            var mainPageContent = SiteContentDownloader.GetContent(_siteUrl);

            //Analyze the HTML for keywords and accessibility features.
            var keywords      = new KeywordAnalyzer(mainPageContent.Content).AnalyzeHtml();
            var accessibility = new AccessibilityAnalyzer(mainPageContent.Content).AnalyzeHtml();

            var cleanHtml = SiteCleaner.CleanSiteHtml(mainPageContent);

            return(new SiteReview()
            {
                URL = _siteUrl,
                AccessibilityResult = accessibility,
                KeywordResult = keywords,
                TimeToLoad = mainPageContent.TimeToDownload,
                HtmlContent = cleanHtml
            });
        }