I am having some trouble retrieving text with the GetText function of the IE activeX window
Passing LoadString some HTML works nicely, and displays in the window as expected.
Then I try to retrieve immediately using the GetText(True), and I get back som valid but empty html:
<p> </p>
Can anyone give me some sample code on how to do this?
Also, if anyone has some sample code accing the ie DOM via wxPython, I’d love to see it.
Paul Wray
···
This message is intended for the addressee named and may contain
privileged information or confidential information or both. If you
are not the intended recipient please delete it and notify the sender.
Hello
I am having some trouble retrieving text with the GetText function of the IE activeX window
Passing LoadString some HTML works nicely, and displays in the window as expected.
Then I try to retrieve immediately using the GetText(True), and I get back som valid but empty html:
<p> </p>
It can't be done immediately because the text hasn't been loaded yet. If you give the component time to load the string then it will work fine. For example I just did the following in the widget inspection tool in the demo:
>>> obj
<wx.lib.iewin.IEHtmlWindow; proxy of <Swig Object of type 'wxIEHtmlWindowBase *' at 0x2103530> >
>>> obj.LoadString("wxPython"); print obj.GetText(True)
True
<P> </P>
>>>
>>> obj.LoadString("<b>Hello</b> World!")
True
>>> obj.GetText(True)
u'<B>Hello</B> World!'
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!