HTML 애자일 팩을 사용하여 내 프로그램에서 파일을 읽고 모든 이미지 srcs를 가져 오려고합니다. 내가 지금까지 얻은 것들을 heres :
private ArrayList GetImageLinks(String html,String link)
{
//link = url of webpage
//html = a string of the html, just for testing will remove after
HtmlAgilityPack.HtmlDocument htmlDoc = new HtmlAgilityPack.HtmlDocument();
htmlDoc.OptionFixNestedTags = true;
htmlDoc.Load(link);
List<String> imgs = (from x in htmlDoc.DocumentNode.Descendants()
where x.Name.ToLower() == "img"
select x.Attributes["src"].Value).ToList<String>();
Console.Out.WriteLine("Hey");
ArrayList imageLinks = new ArrayList(imgs);
foreach (String element in imageLinks)
{
Console.WriteLine(element);
}
return imageLinks;
}
그리고 이것은 받고있는 오류입니다 : System.ArgumentException : URI 형식이 지원되지 않습니다.