如何确保人类而不是机器人访问不同的网页?
如何保证不同的网页是人访问的,而不是机器人程序访问的? 有什么技巧吗?
谢谢
how to ensure visit different web pages by human, not by bot program?
Is there some tecnique?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是一个 PHP 示例,用于查找访问者是否是 GoogleBOT。
This is an PHP example of finding out, if the visitor is GoogleBOT.
您可以更改 HTTP 标头中的用户代理,或者查找类似机器人的活动,例如来自单个 IP 地址的大范围页面的非常高频率的点击(尽管您也可能会在代理服务器中看到这种情况) )。您还可以查找 Robots.txt 上的点击,并假设同一会话中的其他访问也来自机器人。
事实上,没有可靠的方法可以做到这一点,因为复杂的机器人作家可以假装是浏览器。
You can either change the User Agent in the HTTP headers, or look for bot like activity, such as a very high frequency of hits over a wide range of pages coming from a single ip address (though you might see that with a Proxy Server too). You can also look for hits on Robots.txt and assume that other visits within the same session where also from a robot.
In reality there is no sure fire way of doing it, as sophisticated robot writers could pretend to be browsers.
时间可以很好地衡量访问者是人类还是机器人。
如果您对跟踪用户访问的 JavaScript 设置超时或延迟,则在 1 或 2 秒后执行。大多数人至少会在这段时间内访问一个页面(即使他们不喜欢它),而机器人应该能够在这段时间内扫描并继续前进。
只是一个想法。
Time can be good measurement of whether a visit was a human or a bot.
If you set a time-out or delay on the JavaScript which tracks the user visit to execute after 1 or 2 seconds. Most humans will visit a page for at least that time (even if they don't like it) whereas a bot should be able to scan and move on in that time.
Just a thought.