【问题标题】:How can I determine if it is a bot browsing my website or a person?如何确定是机器人浏览我的网站还是个人?
【发布时间】:2014-11-12 18:47:13
【问题描述】:

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

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

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

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

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

【问题讨论】:

  • “我做了一些额外的后台数据库调用”如何?什么时候?何时使用自动补全?
  • 为机器人解析 USER_AGENT,如果它匹配一个,它就是一个机器人;)但是现代机器人能够像人类一样提交表单
  • HTTP 头 User-Agent 并且不要忘记 robots.txt
  • 听起来像是没有建立优化的优化。不要忘记您花在这上面的每一个小时都是额外的投资。
  • 我不知道要识别的代码,但您是否尝试过 captcha code 使用图片,这应该可以解决您的问题

标签: java html jsp


【解决方案1】:

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

表格内

<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});
})();

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

【讨论】:

    猜你喜欢
    • 2013-08-25
    • 2010-11-23
    • 1970-01-01
    • 2010-10-24
    • 1970-01-01
    • 2012-07-26
    • 1970-01-01
    • 2013-01-17
    • 1970-01-01
    相关资源
    最近更新 更多