find all images id from html file and store in array in c#
-
Hi All, I have html file, I want to find out all images and their ids from html file and store all images id in array. Please need your help... Thanks Rajesh
You could use regular expressions to do this.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
Hi All, I have html file, I want to find out all images and their ids from html file and store all images id in array. Please need your help... Thanks Rajesh
-
Hi All, I have html file, I want to find out all images and their ids from html file and store all images id in array. Please need your help... Thanks Rajesh
Use the WebBrowser control that comes with .NET. You can use the WebBrowser.Document.Images collection to get the list of image tags in the html page.
WebBrowse1.Navigate("c:\mypage.html");
List<string> images = new List<string>();
HtmlElementCollection elements = WebBrowser1.Document.Images;
foreach(HtmlElement e in elements) {
images.Add(e.Attributes("id");
}