Is there a way to obtain the HTML of a web page using the .NET compact framework?

元气小坏坏 提交于 2019-12-24 21:18:19

问题


As the WebBrowser control does not expose a get accessor for the DocumentText property you cannot use it to obtain the HTML that was loaded into this control. Does anyone know a way to obtain the HTML as a string?

I am using .NET CF3.5.


回答1:


Use HttpWebRequest class. Here is an example on how to do that.




回答2:


Have you tried WebBrowser.Document?

System.Windows.Forms.HtmlDocument document = this.webBrowser1.Document;

It's exposed as:

[BrowsableAttribute(false)] public HtmlDocument Document { get; }




回答3:


Can't you use the HttpWebRequest?



来源:https://stackoverflow.com/questions/1870028/is-there-a-way-to-obtain-the-html-of-a-web-page-using-the-net-compact-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!