Reputation: 41417
Does WebKit expose an API for working directly with its DOM? I'm looking for a class like HtmlElement that can be used to build/traverse trees of HTML content.
I'm trying to host WebKit as a web browser control in a desktop application, and would prefer a direct API rather than going through COM. Thanks!
Thanks!
Upvotes: 10
Views: 8477
Reputation: 10634
Using QT/WebKit (at least version 4.6) it's now possible to access the DOM of the loaded document.
Upvotes: 6
Reputation: 259
you have a limited number of options, via the various DOM wrappers. the PyWebkitQt one is truly rubbish; the Objective-C one is only available on MacOSX (and is again limited and incomplete); the COM one is only available on windows; the GObject one is still under development even though the first version that was created in 2008 was superior and more feature-complete than what's actually now in webkit mainline source code; there are also some c++ bindings but i have not evaluated them. and then of course there's also the Javascript bindings and the google V8 javascript bindings (yes they're separate) but those are only available "in-browser".
that pretty much leaves the pythonwebkit project - http://www.gnu.org/software/pythonwebkit - as the only non-javascript-based DOM manipulation API that actually aims for full de-facto standards compliance, making python truly a peer of javascript when it comes to DOM manipulation.
Upvotes: 1