Prevent PHP scraping by adding blank spaces in your code (website scraping)

Here is the code, just an image. You can find the actual code in this .txt file.


How does it work and what it does?

This php code will add random html blank spaces, making the scraping a little bit harder to do.

A scrapper usually goes by a pattern. He detects and steals the content between some HTML lines. If the lines have random blank spaces, it will get harder for the scrapper to get the content.

You can add those random blank spaces by adding ‘.$scrapper_array[rand(0, count($scrapper_array) – 1)].’ anywhere on your page (in an echo, obviously).

If you don’t understand or you need more help, leave in the comments.