gpt4 book ai didi

java - 如何确定是机器人浏览我的网站还是人?

转载 作者:太空宇宙 更新时间:2023-11-04 14:23:46 25 4
gpt4 key购买 nike

如何确定是否有机器人浏览我的网页?

我有一个网站,用户可以在其中提交表单以进入下一页。

我做了一些额外的后台数据库调用,以便当用户提交表单时,页面速度更快。

当它是机器人时,我不需要这样做,因为它们无论如何都无法访问网站的该部分,因为它是使用表单访问的

如何确定是否有机器人浏览我的页面?

最佳答案

我一直在使用这个小技巧来清除提交表单的机器人......而且效果非常好。

在表单内

<li class="realTest" title="We just want to make sure you're from this planet and not a robot.">
<label class="title" for="humanTest1">Check for Human</label>
<input type="text" name="humanTest1" id="humanTest1" tabindex="-1" placeholder="Leave this field blank. *"/>
</li>

Javascript

(function () {
$('.realTest').css({'opacity' : 0, 'height' : 0, 'visibility' : 'hidden', 'position' : 'absolute', 'left' : -9999, 'z-index' : -9999});
})();

您所要做的就是检查该值。如果它是空的,那么它就是一个人;如果它是空的,那么它就是一个人。如果不是,那么它就是一个机器人。

关于java - 如何确定是机器人浏览我的网站还是人?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26894282/

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