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); }
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(); } }