What is the smartest way to block IPs which browsing site quickly?

I mean filtering out unnatural visits like bots who getting site structure and browsing it..

Looking for automated solution software which will ban it automatically, for temporary period of time.

Like do 200 hits in 5 minutes, get banned for 2 hours ?