Difference between IE 10 rendered HTML and its output HTML

我们两清 提交于 2019-12-08 13:52:45

问题


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>

Code:

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

Why are they different?

Update:

Below is the Fiddler monitor result.

IE10:

WebClient:


回答1:


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.




回答2:


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

And I have solved it there.



来源:https://stackoverflow.com/questions/12824081/difference-between-ie-10-rendered-html-and-its-output-html

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