How to call WebKit.DOMDocument.evaluate function in python



Greetings,

I realize that this question is specific to python and webkit and not a
general Gtk question. I have tried many other avenues including
stackoverflow question and sending mails to various other lists. So far no
luck. Since there are many Gtk experts here, I am hoping someone might be
able to help me.

I am using Ubuntu desktop versions 12.04 and 13.04 for developing my python
application. Application hosts a webkit webview which in turn displays a
page. Its a very simple application - almost like hello world application
using webkit webview.

I need to perform some DOM operations once the document is loaded. Webkit
DOMDocument provides evaluate method which can allow me to reach to element
using xpath,  if it works. The parameter DOMXPathResult of the evaluate
method has annotations declared in such a way that null/None value in
python can not be used.  However null value in this case is legal and
accepted.

This is creating sort of circular problem since only way we can get valid
WebKitDOMXPathResult is from other call to evaluate.

I have used evaluate function in other languages such as c and know it does
work properly if I send null to above said parameter.


Is there any way to get underlying gobject pointer from python so that I
can use ctypes and try to call function directly. So far my attempts have
resulted in coredump as webkit is asserting on various values I am sending
to it.


Any other option to get me going is also very very very welcome. Ideally I
would like to distribute my script that should work with installed Webkit
version, so anything that does not involve building any code will be great.

Thanks,

Niranjan


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]