我有一个相当大的音乐网站,有一个很大的艺术家数据库。我一直注意到其他音乐网站在窃取我们网站的数据(我在这里和那里输入假艺人的名字,然后进行谷歌搜索)。
如何防止屏幕刮擦?这可能吗?
我有一个相当大的音乐网站,有一个很大的艺术家数据库。我一直注意到其他音乐网站在窃取我们网站的数据(我在这里和那里输入假艺人的名字,然后进行谷歌搜索)。
如何防止屏幕刮擦?这可能吗?
当前回答
与其将机器人列入黑名单,不如将它们列入白名单。如果你不想让你的搜索结果失去前几个引擎,你可以把他们的用户代理字符串列入白名单,这通常是广为人知的。不那么道德的机器人倾向于伪造流行网络浏览器的用户代理字符串。排名靠前的几个搜索引擎应该会为你带来95%以上的流量。
识别机器人本身应该是相当简单的,使用其他帖子建议的技术。
其他回答
大多数已经说过了,但是你考虑过CloudFlare的保护吗?我的意思是:
其他公司可能也这么做,CloudFlare是我知道的唯一一家。
我很确定这会使他们的工作复杂化。我还曾经因为速率限制而试图废弃一个受CloudFlare保护的网站的数据(我使用了简单的AJAX请求循环),导致IP被自动禁用了4个月。
提供一个XML API来访问您的数据;以一种易于使用的方式。如果人们想要你的数据,他们就会得到,你不妨全力以赴。
通过这种方式,您可以以有效的方式提供功能子集,至少确保刮刮器不会消耗HTTP请求和大量带宽。
然后,您所要做的就是说服想要您的数据的人使用API。;)
不,不可能停止(以任何方式) 拥抱它。为什么不发布为RDFa,成为超级搜索引擎友好,并鼓励重复使用数据?人们会感谢你,并在适当的时候提供信用(以musicbrainz为例)。
这可能不是你想要的答案,但为什么要隐藏你想要公开的东西呢?
如果你想看一个很好的例子,请访问http://www.bkstr.com/。他们使用j/s算法来设置cookie,然后重新加载页面,以便它可以使用cookie来验证请求是否正在浏览器中运行。一个为抓取而构建的桌面应用程序绝对可以做到这一点,但它会阻止大多数cURL类型的抓取。
快速解决这个问题的方法是设置一个陷阱。
Make a page that if it's opened a certain amount of times or even opened at all, will collect certain information like the IP and whatnot (you can also consider irregularities or patterns but this page shouldn't have to be opened at all). Make a link to this in your page that is hidden with CSS display:none; or left:-9999px; positon:absolute; try to place it in places that are less unlikely to be ignored like where your content falls under and not your footer as sometimes bots can choose to forget about certain parts of a page. In your robots.txt file set a whole bunch of disallow rules to pages you don't want friendly bots (LOL, like they have happy faces!) to gather information on and set this page as one of them. Now, If a friendly bot comes through it should ignore that page. Right but that still isn't good enough. Make a couple more of these pages or somehow re-route a page to accept differnt names. and then place more disallow rules to these trap pages in your robots.txt file alongside pages you want ignored. Collect the IP of these bots or anyone that enters into these pages, don't ban them but make a function to display noodled text in your content like random numbers, copyright notices, specific text strings, display scary pictures, basically anything to hinder your good content. You can also set links that point to a page which will take forever to load ie. in php you can use the sleep() function. This will fight the crawler back if it has some sort of detection to bypass pages that take way too long to load as some well written bots are set to process X amount of links at a time. If you have made specific text strings/sentences why not go to your favorite search engine and search for them, it might show you where your content is ending up.
无论如何,如果你从战术和创造性的角度思考,这可能是一个很好的起点。最好的办法就是学习机器人是如何工作的。
我还会考虑打乱一些ID或页面元素上的属性显示方式:
<a class="someclass" href="../xyz/abc" rel="nofollow" title="sometitle">
每次都会改变它的形式,因为一些机器人可能会在你的页面或目标元素中寻找特定的模式。
<a title="sometitle" href="../xyz/abc" rel="nofollow" class="someclass">
id="p-12802" > id="p-00392"