c# - How to get html from an element in WebKit.Net -


i'm migrating old project webkit.net 0.5 cairo. roadblocks i've gotten past can't figure out how html individual webkit.dom.element object.

i can read html of entire document using webkitbrowser.documenttext, not need.

below i'm trying accomplish. i've browsed through docs , done lot of searching , have come empty on fronts. i've found no way accomplish last line in snippet.

webkit.dom.element newdiv = webkitbrowser1.document.createelement("div"); ... [ create span's , append them newdiv ] ... string divhtml = newdiv.documenttext // <-- documenttext not member of webkit.dom.element 

with ie control, divhtml = newdiv.innerhtml, can't find equivalent webkit.net.

as alternative, accept solution inject html element such can manually add img tag without creating dom element it. using divhtml.textcontent, html interpreted plain text.

thanks in advance!

edit : further trial , error has led less optimal functional solution in form of

webkit.dom.element newdiv = webkitbrowser1.document.createelement("div"); ... [ create span's , append them newdiv ] ... string divhtml = webkitbrowser1.stringbyevaluatingjavascriptfromstring("document.getelementbyid('divelementid').innerhtml"); 

the same method can used set innerhtml of element.

this solves un-mentioned issue of webkitbrowser.documenttext reflecting original html , not modified results.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -