Пример #1
0
 public static string GetContent(string url, string cacheFilePath)
 {
     try
     {
         using (var client = new WScrapeWebClient())
         {
             var content = client.DownloadString(url);
             //File.WriteAllText(cacheFilePath, content);
             return content;
         }
     }
     catch (WebException)
     {
         return File.Exists(cacheFilePath) ? File.ReadAllText(cacheFilePath) : string.Empty;
     }
 }