10

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!

Tony the Pony
  • 40,327
  • 71
  • 187
  • 281

3 Answers3

6

Using QT/WebKit (at least version 4.6) it's now possible to access the DOM of the loaded document.

QtWebKit Module reference

DOM Traversal Example

Luca Tettamanti
  • 10,314
  • 3
  • 29
  • 25
3

Following URL has some interesting answer to you.

Where is WebKIT API?

lakshmanaraj
  • 4,145
  • 23
  • 12
  • by taking the source code and compiling it, of course - how else? sorry, but this is a silly question, jen :) – user362834 Oct 09 '10 at 18:44
1

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.

user229044
  • 232,980
  • 40
  • 330
  • 338
user362834
  • 259
  • 2
  • 5