Frage

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?

War es hilfreich?

Lösung 2

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

And I have solved it there.

Andere Tipps

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top