Take the 2-minute tour ×

I use IE 10 F12 button to locate a < a > node on my page, I got this:

<a tabindex="-1" class="level1 static" href="About.aspx">About</a>

But I use the following code to retrieve the page HTML, and get this:

<a class="level1" href="About.aspx">About</a>


        WebClient wc = new WebClient();
        String pageString = wc.DownloadString(url);

Why are they different?


Below is the Fiddler monitor result.


enter image description here

enter image description here


enter image description here

enter image description here

share|improve this question
add comment

2 Answers

It's typical for webservers to send different output depending on which browser the request is coming from. Perhaps this "simplified" <a> tag is a result of that?

I'm not sure how WebClient works but perhaps it's possible to modify headers so you can act like you're an IE10 browser and see if the results are different.

share|improve this answer
If so, is there any way for me to simulate the IE to get the "full" < a > tag? –  smwikipedia Oct 10 '12 at 16:33
Right, I know for a fact that browser information is stored somewhere in the Http request which you can find the details of. I looked briefly and WebClient has a Headers dictionary, which may or may not be what you want. Honestly, what I'd do at this point is use Fiddler to get a sample Http request from IE10 and then see if you could do something similar in WebClient. The more educational way might be to find the specification for requests. –  roliu Oct 10 '12 at 16:37
I simulated the User-Agent header, but still not work. –  smwikipedia Oct 10 '12 at 17:21
Could you update your original post with your detailed results? It could also be possible that when you load the page in a browser it comes with javascript that modifies the Html. –  roliu Oct 10 '12 at 17:24
I have updated my post. Actually, there're some WebResource.axd handling. But I don't know what it does. –  smwikipedia Oct 10 '12 at 17:33
show 2 more comments
up vote 0 down vote accepted

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

And I have solved it there.

share|improve this answer
add comment

Your Answer


