WebBrowser Navigation and Management

Can I use XPAth expressions to navigate DOM elements in a WebBrowser control? Maybe there is javascript code and use the document.evaluate function correctly?

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

+7
c # browser xpath
source share
1 answer

The Microsoft WebBrowser control is a managed shell for the Microsoft COM web browser, as I understand it. So, under the hood, this is the same rendering and implementation of the DOM that IE uses that is called MSHTML. Because it does not support XPath against its HTML DOM, it does not support the "evaluation" method (which is part of the W3C DOM Level 3 XPath). I don’t see a way to fulfill XPath requests regarding an HTML document loaded into a Microsoft WebBrowser control. Are there any third-party .NET web browser controls based on other browsers that support XPath against HTML DOM, I don’t know.

If you want to use .NET to run XPath on an HTML document, then the HTML flexibility package . However, this does not depend on the WebBrowser control, so you cannot use it to navigate the HTML document loaded in the WebBrowser control, instead you will work with a separate implementation.

+7
source share

All Articles