Exemplo n.º 1
0
 public static void FixLinks(this HtmlAgilityPack.HtmlNode source, string baseUrl)
 {
     foreach (var attribute in source.SelectDescendantsAttributes("img", "src"))
     {
         try { attribute.Value = new Uri(new Uri(baseUrl), attribute.Value).AbsoluteUri; } catch { }
     }
     foreach (var attribute in source.SelectDescendantsAttributes("*", "href"))
     {
         try { attribute.Value = new Uri(new Uri(baseUrl), attribute.Value).AbsoluteUri; } catch { }
     }
 }