c# - WinForms WebBrowser HTMLDocument strips tags -
c# - WinForms WebBrowser HTMLDocument strips tags -
i having issues working htmldocument object contained/provided webbrowser control.
it seems when utilize getelementsbytagname("ol")
, returned result stripped downwards version of webbrowser.documenttext
property contains. there reason this? doing wrong elements out?
here's example:
string html = "<html><head></head><body><ol type=\"i\"><li>someitem</li></ol></body></html>"; //this part allows me load html htmldocument of webbrowser control, // without having render command on form this.webbrowser1.navigate("about:blank"); this.webbrowser1.document.write(html); //then document object in order work elements properly. htmldocument doc = this.webbrowser1.document; //then lists contained in document... , play those. htmlelementcollection ol_lists = doc.getelementsbytagname("ol"); foreach(htmlelement ol in ol_lists) { string type = ol.getattribute("type"); }
this code illustration gives me within type
:
""
then, if in order see why it's empty:
string outer_html = ol.outerhtml;
i next result:
class="lang-html prettyprint-override"><ol><li>someitem</li></ol>
which not in web browser... because if this:
string text = this.webbrowser1.documenttext;
i result:
class="lang-html prettyprint-override"><html><head></head><body><ol type="i"><li>someitem</li></ol></body></html>
and if allow code run through , display html contents browser control, displays list roman numerals items... html code made in there ok... doing wrong? how can actual element properties , else htmldocument object?
c# html winforms
Comments
Post a Comment