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:
SHDocVw.InternetExplorer IE = new SHDocVw.InternetExplorer();
IE.Visible = false;
IE.Navigate("www.testsite.com");
I want something like:
string source = IE.ToSource();
So I can inspect the content of it.
Can I achieve this? Thanks.
Try that:
You can access the whole HTML string from the body.parent property:
You can see a nice example here (the example in c++)