How to get the page source from an IE window?

霸气de小男生 提交于 2019-12-08 14:01:53

问题


I need to parse the page source as rendered by IE.

I can use the following simple code to open an IE to a URL.

(The BrowserWinodw type is from the Visual Studio Coded UI test framework.)

BrowserWindow bw = BrowserWindow.Launch(url);

How to get the page source from the IE window?

Thanks!


回答1:


I have figured out a way to do it. Use the IHtmlDocument2 interface. With reference to this article: http://support.microsoft.com/kb/292485

I will share my code snippet shortly.



来源:https://stackoverflow.com/questions/12842277/how-to-get-the-page-source-from-an-ie-window

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!