You're going about it the wrong way
You need to use the HtmlElementCollection object with the GetElementsByTagName method, as in :
This downloads all the pictures to a folder on your C drive.Code:private void button1_Click(object sender, EventArgs e) { System.Net.WebClient wc = new System.Net.WebClient(); HtmlElementCollection imgs = this.webBrowser1.Document.GetElementsByTagName("img"); for (int i = 0; i < imgs.Count; i++) { wc.DownloadFile(imgs[i].GetAttribute("src"), "c:\\images" + i.ToString() + ".jpg"); } } private void Form1_Load(object sender, EventArgs e) { this.webBrowser1.Navigate("C:\\imagetest.htm"); }





Reply With Quote