导航和WebBrowser控件 [英] Navigation and WebBrowser control

查看:164
本文介绍了导航和WebBrowser控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用XPath前pressions通过WebBrowser控件的DOM元素进行导航?可能是连接的JavaScript code和使用关于document.evaluate功能是正确的方式?

Can i use XPAth expressions to navigate through DOM elements in WebBrowser control? May be attaching javascript code and use document.evaluate function is right way?

能否另一个ActiveX浏览器组件(火狐,webkit.net)帮我解决我的任务是什么?

Can another activeX browser component(firefox,webkit.net) help me to solve my task?

推荐答案

微软WebBrowser控件是围绕微软的COM Web浏览器控件的托管包装,据我了解它。所以发动机罩下它是相同的渲染和DOM实现该IE使用,称为MSHTML。由于不支持的XPath针对其HTML DOM,不支持评估的方法(这是W3C DOM 3级的XPath的一部分),我没有看到针对微软的WebBrowser控件加载HTML文档执行XPath查询方式。
是否有支持的XPath针对HTML DOM我不知道基于其他浏览器的第三方.NET的Web浏览器控件。

The Microsoft WebBrowser control is a managed wrapper around Microsoft's COM web browser control, as far as I understand it. So under the hood it is the same rendering and DOM implementation that IE uses, called MSHTML. As that does not support XPath against its HTML DOM, does not support the 'evaluate' method (which is part of W3C DOM Level 3 XPath) I don't see a way to perform XPath queries against a HTML document loaded in Microsoft's WebBrowser control. Whether there are third party .NET web browser controls based on other browsers that support XPath against a HTML DOM I don't know.

如果你想使用.NET来对一个HTML文档执行的XPath再有就是的HTML敏捷包。这是独立于WebBrowser控件但是,所以你不能用它来导航的WebBrowser控件加载HTML文档,而不是你要做一个单独的实施工作。

If you want to use .NET to perform XPath against a HTML document then there is the HTML agility pack. That is independent of the WebBrowser control however so you can't use it to navigate a HTML document loaded in a WebBrowser control, instead you would work with a separate implementation.

这篇关于导航和WebBrowser控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆