所以我有一个网站,要求用户在看到任何信息之前验证其年龄,如果您的年龄超过18岁,我会显示选项以选择div:
<div class="ct-preloader">
<div class="contenido-edad">
<div class="ct-mediaSection-inner ct-u-paddingTop100">
<div class="container">
<div class="row">
<div class="col-sm-10 col-sm-offset-1">
<h4 class="text-center"><small>VNO es una aplicación para mayores de edad, al entrar aceptas nuestros términos y condiciones.</small></h4>
<h2 class="text-center ct-u-marginTop0"><small class="text-uppercase ct-u-cabin ct-u-ls-10 ct-u-ls--xs0">¿Eres mayor de edad? (+18)</small></h2>
<div class="text-center">
<a href="#" class="btn btn-default boton-si"><span> Sí </span></a>
<a href="http://omfgdogs.com" class="btn btn-default boton-no"><span> No </span></a><br><br><br>
<input type="checkbox" name="vehicle" value="si" id="recordarPreferencia"> ¿Recordar preferencia?
</div>
</div>
</div>
</div>
</div>
</div>
</div>
我用这个CSS:在整个网页上做得很好
.ct-preloader {
position: fixed;
z-index: 99998;
width: 100vw;
height: 100vh;
background: #fff;
overflow: hidden;
}
问题是,我认为这会使我在谷歌上的排名下降,因为这就是谷歌机器人所看到的,所以我想知道是否有办法对谷歌和其他机器人隐藏整个div,我所说的网站是https://vno.mx
建议网络爬虫不要访问您网站上的内容的最佳方法是创建一个robots.txt文件。看见http://robotstxt.org.没有办法告诉机器人不要访问页面的一部分
http://code.google.com/web/controlcrawlindex/docs/faq.html#h22
如果你打算使用CSS,请记住机器人仍然可以读取CSS文件!您可以在robots.txt文件中包含CSS文件,但要排除它。
如果你真的必须在同一页上有索引和未索引的内容,也许你应该使用框架,并在robots.txt文件中列出未索引的框架作为不索引。
行为良好的爬虫会遵循robots.txt指南,例如谷歌,但顽皮的爬虫不会。因此,无法保证。