Esempio n. 1
0
        public static async Task Main()
        {
            var dataSaver   = new DataSaverToDirectory(new DirectoryInfo($@"{Directory.GetCurrentDirectory()}\src"));
            var constraints = new Constraint(LinkTransitionConstraintType.CurrentDomain, new [] { "img", "jpg", "js", "css" });
            var wget        = new WebSiteDownloader(dataSaver);

            await wget.DownloadWebsiteAsync(@"https://stackoverflow.com/questions", constraints, 1);
        }
Esempio n. 2
0
        protected override void ExecuteTask()
        {
            WebSiteDownloaderOptions options;
            WebSiteDownloader        downloader;

            foreach (SpiderUrl spiderUrl in SpiderUrls)
            {
                options = spiderUrl.Options;
                options.DestinationFolderPath = new DirectoryInfo(this.DestinationFolderPath);
                downloader = new WebSiteDownloader(options);
                downloader.Process();
            }
        }