gpt4 book ai didi

javascript - 您如何在 Google richsnippets 测试工具中测试 AngularJS 网络应用程序的 schema.org 元标记?

转载 作者:行者123 更新时间:2023-11-29 17:01:06 25 4
gpt4 key购买 nike

该网站的代码是使用 AngularJS javascript 框架生成的。当我访问一个网页时,它会完整地显示该页面,但源代码正在加载源代码中未完全存在的部分,例如:

<body>
<div class="wrapper">
<div ng-include="'partials/header.html'"></div>
<div id="ng-view" ng-view class="main_view wrapper"></div>
<!--div ng-include="'partials/home_content.html'"></div-->
<a href="#"> </a>
</div>
<div ng-include="'partials/footer.html'" class="footer"></div>
</body>

如何在 https://www.google.com/webmasters/tools/home 中测试部分代码(页眉、内容、页脚) ?

最佳答案

我正在使用一个名为 prerender 的软件来确保抓取工具实际上可以抓取我的单页应用程序网站以便为它们编制索引。

所以我只为测试工具提供了一个预呈现的页面来处理,我认为这是个好主意,因为这正是爬虫获取您的页面的方式。

我正在使用 prerender,它可以安装在您的服务器上或通过他们的服务器使用(收费),更多信息请访问:https://prerender.io/documentation

关于javascript - 您如何在 Google richsnippets 测试工具中测试 AngularJS 网络应用程序的 schema.org 元标记?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28027728/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com