I am using the documentText attribute to get the source code of website. However a website like google executes javascript to dynamically create its website. If I look at documentText it won’t be what is displayed on screen. However you can go to IE developer tools and copy the the outerHTML from there and you get the document as it is formatted on the screen.
Is there a way to access the formatted code somehow?
Answer:
Thanks to @Adam
The following will get you html as actually displayed on the screen.
string html = webBrowser1.Document.Body.Parent.OuterHtml;
The “formatted code” will be the copy in the DOM.
You can use standard DOM traversal in order to copy the resulting data.