I getting one image with HTMLAgilityPack and then I want to load it as byte so I could save it in database.
byte[] bIMG = File.ReadAllBytes(doc.DocumentNode.SelectSingleNode("//img[@class='image']").Attributes["src"].Value);
But it says URI formats are not supported. how else I can do that?
EDIT: doc.DocumentNode.SelectSingleNode(“//img[@class=’image’]”).Attributes[“src”].Value gives a link
The
System.IO.Fileclass can’t read web URIs – you can use the WebClient for this: