如何从IE窗口获取页面源? [英] How to get the page source from an IE window?
本文介绍了如何从IE窗口获取页面源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要解析IE呈现的页面源。
I need to parse the page source as rendered by IE.
我可以使用以下简单代码将IE打开到URL。
I can use the following simple code to open an IE to a URL.
(BrowserWinodw类型来自Visual Studio编码的UI测试框架。)
(The BrowserWinodw type is from the Visual Studio Coded UI test framework.)
BrowserWindow bw = BrowserWindow.Launch(url);
如何从IE窗口获取页面源?
How to get the page source from the IE window?
谢谢!
推荐答案
我想出了一种方法。使用IHtmlDocument2接口。参考本文: http://support.microsoft.com/kb/292485
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.
这篇关于如何从IE窗口获取页面源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文