我有一个相当大的音乐网站,有一个很大的艺术家数据库。我一直注意到其他音乐网站在窃取我们网站的数据(我在这里和那里输入假艺人的名字,然后进行谷歌搜索)。

如何防止屏幕刮擦?这可能吗?


当前回答

快速解决这个问题的方法是设置一个陷阱。

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"

其他回答

对不起,这真的很难做到……

我建议你礼貌地要求他们不要使用你的内容(如果你的内容是受版权保护的)。

如果是这样,他们不把它撤下来,那么你可以采取进一步的行动,给他们发一封停止通知信。

一般来说,无论你做什么来防止抓取可能最终会产生更负面的影响,例如可访问性,机器人/蜘蛛等。

你不能停止正常的屏幕抓取。不管是好是坏,这就是网络的本质。

你可以让任何人都不能访问某些东西(包括音乐文件),除非他们以注册用户的身份登录。在Apache中做到这一点并不难。我想在IIS中也不会太难。

生成HTML, CSS和JavaScript。编写生成器比编写解析器更容易,因此可以以不同的方式生成每个服务页面。这样就不能再使用缓存或静态内容了。

我已经做了很多网络抓取,并在我的博客上总结了一些技巧来阻止网络抓取,基于我觉得讨厌的东西。

这是你的用户和刮刀者之间的权衡。如果你限制IP,使用验证码,要求登录,等等,你会给刮刀器带来困难。但这也可能会赶走真正的用户。

大多数已经说过了,但是你考虑过CloudFlare的保护吗?我的意思是:

其他公司可能也这么做,CloudFlare是我知道的唯一一家。

我很确定这会使他们的工作复杂化。我还曾经因为速率限制而试图废弃一个受CloudFlare保护的网站的数据(我使用了简单的AJAX请求循环),导致IP被自动禁用了4个月。