When I instantiate an IE object and navigate to a url, I don\'t know how to obtain the source HTML code from that address.
This is the code I\'m using:
Try that:
SHDocVw.InternetExplorer IE = new SHDocVw.InternetExplorer();
IE.Visible = false;
IE.Navigate("www.testsite.com");
mshtml.IHTMLDocument2 htmlDoc
= IE.Document as mshtml.IHTMLDocument2;
string content = htmlDoc.body.outerHTML;
You can access the whole HTML string from the body.parent property:
string content = htmlDoc.body.parent.outerHTML;
You can see a nice example here (the example in c++)