[Kde-bindings] dcop access to html parse tree

Richard Dale Richard_Dale at tipitina.demon.co.uk
Wed Sep 1 09:00:54 UTC 2004


On Wednesday 01 September 2004 00:49, Markus Heller wrote:
> how can I make konqueror do the following through DCOP:
>
> - start up (is OK)
>
> - open a homebanking website: Handover of the URL as a cmdline option is
> not possible, because then the page will be downloaded first, and the
> following submit of user data will go to the downloaded file instead of to
> the bank... producing an error. I need to know which function whereabout in
> the scop tree accepts the URL.
>
> - enter the credentials to the according text fields: I need to know if and
> how the parse tree of the html page is represented through DCOP.
> Especially, how the various html items, especially html fields and
> interactive components such as submit buttons  can be accessed through DCOP
I don't think there is an interface to the 'parse tree of the html page' via 
docp.

> - simulate a click on a "login" field (an image): see above. I need to
> submit the previously entered credentials.
>
> - get any kind of feedback that the login page has finished loading: I need
> to know how long it took to load the page. This requires feedback in a
> sense that my script monitors the dcop interface and stops the counter if
> the page has been loaded. It should be possible to access the status of the
> little "loading" icon, the fact if the KDE wheel on the top right corner is
> still turning or if it is the static one.
>
> I want to do everything through DCOP, only through a script, without any
> user interaction.
I don't think you can do that with just the 'dcop' command line utility and 
kdialog, but you don't need to write in C++ either. There are some examples 
of using a KHTMLPart from python and ruby in kdebindings, see:

python/pykde/examples/pyKHTMLPart.py

korundum/rubylib/examples/rbKHTMLPart.rb
korundum/rubylib/examples/RubberDoc.rb
korundum/rubylib/examples/kludgeror.rb

Then you cold write your own 'custom konqueror' to access the homebanking 
website. The RubberDoc.rb example has code to walk round the DOM tree, which 
is the closest thing to your request about needing to access the html parse 
tree. But I'm not sure if there is an interface to KHTMLPart that allows you 
to programmatically fill out text fields though.

-- Richard



More information about the Kde-bindings mailing list