Reputation: 1701
I'm starting to use Mechanize gem for Ruby and I wonder if there is anyway a web server can detect and block activities from Mechanize agent?
If yes, what's the code or steps to block Mechanize to scrap or visit a site?
Upvotes: 3
Views: 1092
Reputation: 160571
There are a number of ways they can detect an automated process is hitting their site:
These don't necessarily point to Mechanize running, but are fingerprints of code scraping a site.
What can they do about it?
There are many different ways to go about those things, depending on their server and networking hardware.
This question is pretty off-topic for StackOverflow and probably should be asked on https://serverfault.com/ or https://webmasters.stackexchange.com/
Upvotes: 2
Reputation: 262694
You can put up a robots.txt file and hope people respect it.
If you start blocking by User-Agent string, they can just pretend to be IE.
Upvotes: 0