在提取网页的HTML源时没有获取当前的HTML页面源

时间:2013-07-26 08:23:26

标签: c# .net information-retrieval

我使用以下方法获取网站的页面源。但我得到的页面源不是该网站的当前页面源。你们任何人都知道为什么会这样吗?

P.S。我正在尝试获取http://www.miniclip.com/games/en/

的页面来源
 public static string GetWebText(string url)
    {
        HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
        request.UserAgent = "A .NET Web Crawler";

        WebResponse response = request.GetResponse();

        Stream stream = response.GetResponseStream();

        StreamReader reader = new StreamReader(stream);
        string htmlText = reader.ReadToEnd();
        return htmlText;
    }

编辑: 这是我对section-id =“featured-games”感到困扰的部分 使用前面提到的方法的本节的页面源如下:

    <section id="featured-games">
            <div class="blue-container">
                <div class="latest-games whitebox">
                    <div class="game-animation">
                        <div id="animation-rotator"></div>
                    </div>
                    <ul class="games-list game-icons">
                                                <li data-animation="freerunning2" data-id="3798" id="animation-3798">
                            <div class="game-notification-container"><div class="game-notification"><div class="icon-new"></div><div class="game-notification-inner">New!</div></div></div><a class="game-icon small-icon game-id-3798"  href="/games/free-running-2/en/#t-h-a"  title=""><span class="icon-wrap"><img src="//static2.miniclipcdn.com/content/game-icons/small/freerunning2V2.jpg" data-track="freerunning2V2" alt="Play Free Running2" title="Play Free Running 2" width="68" height="57" /></span><span class="game-name">Free Running2</span>
</a>                        </li>
                                                <li data-animation="robotragenewarenav2" data-id="3491" id="animation-3491">
                            <a class="game-icon small-icon game-id-3491"  href="/games/robot-rage/en/#t-h-a"  title=""><span class="icon-wrap"><img src="//static2.miniclipcdn.com/content/game-icons/small/3491-robot-13.png" data-track="3491-robot-13" alt="Play Robot Rage" title="Play Robot Rage" width="68" height="57" /></span><span class="game-name">Robot Rage</span>
</a>                        </li>
                                                <li data-animation="penguinattack03" data-id="3748" id="animation-3748">
                            <a class="game-icon small-icon game-id-3748"  href="/games/penguins-attack-iv/en/#t-h-a"  title=""><span class="icon-wrap"><img src="//static2.miniclipcdn.com/content/game-icons/small/penguinsattack4.jpg" data-track="penguinsattack4" alt="Play Pengu Attack" title="Play Penguins Attack IV" width="68" height="57" /></span><span class="game-name">Pengu Attack</span>
</a>                        </li>
                                            </ul>
                </div>
                <div class="hot-games whitebox">
                    <ul class="games-list game-icons">
                                                <li>
                            <a class="game-icon small-icon game-id-1467"  href="/games/club-penguin/en/#t-h-h"  title=""><span class="icon-wrap"><img src="//static.miniclipcdn.com/content/game-icons/small/CP_starwars.jpg" data-track="CP_starwars" alt="Play Club Penguin" title="Play Club Penguin" width="68" height="57" /></span><span class="game-name">Club Penguin</span>
</a>                        </li>
                                                <li>
                            <a class="game-icon small-icon game-id-3814"  href="/games/summer-arcade/en/#t-h-h"  title=""><span class="icon-wrap"><img src="//static.miniclipcdn.com/content/game-icons/small/sony-arcade70x59-2.jpg" data-track="sony-arcade70x59-2" alt="Play Arcade" title="Play Summer Arcade" width="68" height="57" /></span><span class="game-name">Arcade</span>
</a>                        </li>
                                                <li>
                            <a class="game-icon small-icon game-id-3864"  href="/games/smurfette-vs-naughties/en/#t-h-h"  title=""><span class="icon-wrap"><img src="//static2.miniclipcdn.com/content/game-icons/small/smurfettesmallicon.jpg" data-track="smurfettesmallicon" alt="Play Naughties" title="Play Naughties" width="68" height="57" /></span><span class="game-name">Naughties</span>
</a>                        </li>
                                                <li>
                            <a class="game-icon small-icon game-id-2471"  href="/games/8-ball-pool-multiplayer/en/#t-h-h"  title=""><span class="icon-wrap"><img src="//static2.miniclipcdn.com/content/game-icons/small/8ballpoolmultiplayerv7.jpg" data-track="8ballpoolmultiplayerv7" alt="Play 8 Ball Pool" title="Play 8 Ball Pool" width="68" height="57" /></span><span class="game-name">8 Ball Pool</span>
</a>                        </li>
                                                <li>
                            <a class="game-icon small-icon game-id-3800"  href="/games/scooby-doo-great-chase/en/#t-h-h"  title=""><span class="icon-wrap"><img src="//static.miniclipcdn.com/content/game-icons/small/scoobydoochasesmallicon.jpg" data-track="scoobydoochasesmallicon" alt="Play Great Chase" title="Play Great Chase" width="68" height="57" /></span><span class="game-name">Great Chase</span>
</a>                        </li>
                                                <li>
                            <a class="game-icon small-icon game-id-2389"  href="/games/soccer-stars/en/#t-h-h"  title=""><span class="icon-wrap"><img src="//static2.miniclipcdn.com/content/game-icons/small/soccerstars.jpg" data-track="soccerstars" alt="Play Soccer Stars" title="Play Soccer Stars" width="68" height="57" /></span><span class="game-name">Soccer Stars</span>
</a>                        </li>
                                            </ul>
                </div>
            </div>
        </section><!-- section#featured-games -->

0 个答案:

没有答案