[PyKDE] KHTML method returning null

Paul Giannaros ceruleanblaze at gmail.com
Mon Mar 5 16:29:40 GMT 2007


The documentation for KHTML's DOM::Document::getElementById ( 
http://api.kde.org/3.5-api/kdelibs-apidocs/khtml/html/classDOM_1_1Document.html#a20 ) 
show's that the method returns null when an element in the webpage by the 
given ID hasn't been found. I would have thought that would have mapped to 
Python's None, but instead I'm getting a khtml.DOM.Element. Whenever I try to 
call a method on it, my application crashes with "terminate called after 
throwing an instance of 'DOM::DOMException'". 
Firstly, is this intended behaviour? Secondly, is there any way that I can 
check if the return value from that call is a valid object? Maybe there is 
something you can do with the sip module? (though I can't see anything in the 
docs)

Thanks,
Paul




More information about the PyQt mailing list