I am having some problem to get the exactly same HTML string as rendered by IE10. There're some slight difference between the one rendered by IE 10, and the one I retrieved with WebClient.DownloadString(url). (see this question)

How to get the exactly same HTML string? Do I need to simulate the Browser behavior?

有帮助吗?

解决方案 2

This question is duplicated with this one: How to get the page source from an IE window?

And I have solved it there.

其他提示

Try adding the user-agent header for IE10 to your request:

WebClient client = new WebClient ();
client.Headers.Add ("user-agent", "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)");

Depending on your scenario (mobile, x64, etc.), the header might have different values. See IE10 User Agent String Update for other examples.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top