页面源如何不显示页面上的内容? [英] How is it possible for the page source not to show what is on the page?

查看:125
本文介绍了页面源如何不显示页面上的内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的网页:

我试图找出为什么我的列表显示不正确,但这是另一篇帖子.要进行故障排除,我右键单击该页面,然后选择查看页面源".正如您在下面看到的那样,该人员列表(Adam Kinkaid等)甚至都没有出现.那怎么可能?

I'm trying to find out why my list isn't showing up correctly, but that's another post. To troubleshoot, I right-clicked on the page and chose View page source. As you can see below, that list of people (Adam Kinkaid, etc.) doesn't even show up. How is that possible?

页面源:

<!DOCTYPE html>
<html>
<head>
    <title>Presto</title>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <link href="/Content/ie10mobile.css" rel="stylesheet"/>
<link href="/Content/jquery.mobile-1.3.2.css" rel="stylesheet"/>
<link href="/Content/jquery.mobile.structure-1.3.2.css" rel="stylesheet"/>
<link href="/Content/jquery.mobile.theme-1.3.2.css" rel="stylesheet"/>
<link href="/Content/bootstrap.css" rel="stylesheet"/>
<link href="/Content/bootstrap-responsive.css" rel="stylesheet"/>
<link href="/Content/durandal.css" rel="stylesheet"/>
<link href="/Content/toastr.css" rel="stylesheet"/>
<link href="/Content/app.css" rel="stylesheet"/>

    <script type="text/javascript">
        if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
            var msViewportStyle = document.createElement("style");
            var mq = "@-ms-viewport{width:auto!important}";
            msViewportStyle.appendChild(document.createTextNode(mq));
            document.getElementsByTagName("head")[0].appendChild(msViewportStyle);
        }
    </script>
</head>
<body>
    <div id="applicationHost">
        <div class="page-splash"></div>
<div class="page-splash-message">
    Presto
</div>
<div class="progress progress-striped active page-progress-bar">
    <div class="bar" style="width: 100%;"></div>
</div>

    </div>

    <script src="/scripts/jquery-1.9.1.js"></script>
<script src="/scripts/jquery.mobile-1.3.2.js"></script>
<script src="/scripts/knockout-2.2.1.debug.js"></script>
<script src="/scripts/sammy-0.7.4.js"></script>
<script src="/scripts/toastr.js"></script>
<script src="/scripts/Q.js"></script>
<script src="/scripts/breeze.debug.js"></script>
<script src="/scripts/bootstrap.js"></script>
<script src="/scripts/moment.js"></script>

            <script type="text/javascript" src="/App/durandal/amd/require.js" data-main="/App/main"></script>
</body>
</html>

推荐答案

查看源代码"只会为您提供页面加载时的原始页面源.之后,内容可能已使用JavaScript添加到页面中.

"View Source" is only going to give you the original page source from when the page loaded. Content was probably added to the page with JavaScript after that.

该页面似乎正在使用 require.js 动态加载模块:

It looks like the page is loading modules dynamically with require.js:

<script type="text/javascript" src="/App/durandal/amd/require.js" data-main="/App/main></script>

您可以查看已加载的main.js脚本,以查看是否是添加元素的内容.

You can look at the main.js script that gets loaded to see if it's what's adding elements.

使用浏览器的开发人员工具浏览DOM,以获取当前的源".

Use your browser's Developer Tools to explore the DOM to get the current "source".

使用Chrome,只需按 Ctrl + Shift + i 即可打开开发者工具,或右键单击元素,然后单击检查".

With Chrome, just hit Ctrl+Shift+i to open up the Developer Tools, or right-click on an element and "Inspect" it.

这篇关于页面源如何不显示页面上的内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆