Google 的抓取工具是否索引异步加载的元素?
我已经为网站构建了一些在页面加载后异步加载的小部件:
<html>
<head>...</head>
<body>
<div>...</div>
<script type="text/javascript">
(function(){
var ns = document.createElement("script");
ns.type = "text/javascript";
ns.async = true;
ns.src = "http://mydomain.com/myjavascript.js";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(ns, s);
})();
</script>
</body>
</html>
是否有办法通知 Google 爬虫仅在页面完全加载后(异步 JavaScript 修改 HTML 后)才索引页面?
I've built some widget for websites which is asynchronously loaded after the page is loaded:
<html>
<head>...</head>
<body>
<div>...</div>
<script type="text/javascript">
(function(){
var ns = document.createElement("script");
ns.type = "text/javascript";
ns.async = true;
ns.src = "http://mydomain.com/myjavascript.js";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(ns, s);
})();
</script>
</body>
</html>
Is there anyway to notify Google's crawler to index the page only after the page is fully loaded (after the async JavaScript modified the HTML)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不可以。您必须为异步内容设置静态镜像页面。参见这里:
http://code.google.com/web/ajaxcrawling/docs/getting -started.html
No. You have to set up static mirror pages for asynchronous content. See here:
http://code.google.com/web/ajaxcrawling/docs/getting-started.html
从那时起事情就发生了变化:
来源:http:// www.centrical.com/test/google-json-ld-and-javascript-crawling-and-indexing-test.html
Things have evolved since then:
Source: http://www.centrical.com/test/google-json-ld-and-javascript-crawling-and-indexing-test.html