开发者

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

开发者 https://www.devze.com 2022-12-13 18:09 出处:网络
As the WebBrowser control does not expose a get accessor for the DocumentText property you cannot use it to obt开发者_运维问答ain the HTML that was loaded into this control. Does anyone know a way to

As the WebBrowser control does not expose a get accessor for the DocumentText property you cannot use it to obt开发者_运维问答ain 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.


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


Have you tried WebBrowser.Document?

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

It's exposed as:

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


Can't you use the HttpWebRequest?

0

精彩评论

暂无评论...
验证码 换一张
取 消