We've used Incapsula (cheap and works, but awful support and service) and Distil (expensive and works, great support but steep pricing). Both worked, both worked well with http downloads and selenium (and common techniques). Neither worked against someone dedicated enough - but there are the usual tricks for bypassing them (which we used, to test our own stuff). We also developed something in-house, but that never he…
Ask HN: What do people use to prevent crawlers?
21–30 of 123 posts
Re: Ask HN: What do people use to prevent crawlers?
#22What you can do, however, is make it hard so that the vast majority of developers can't do it (e.g. My tech crawl billions of pages, but there was a whole team dedicated to keeping it going). If you have money to spend, there's Distill Networks or Incapsula that have good solutions. They block PhantomJS and browsers that use Selenium to navigate websites, as well as rate limit the bots.
What I found really affective that some websites do is tarpit bots. That is, slowly increase the number of seconds it takes to return the http request. So after a certain amount of request to your site it takes 30+ seconds for the bot to get the HTML back. The downside is that your web servers need to accept many more incoming connections but the benefit is you'll throttle the bots to an acceptable level.
I currently run a website that gets crawled a lot, deadheat.ca. I've written a simple algorithm that tarpits bots. I also throw a captcha every now and then when I see an IP address hits too often over a span of a few minutes. The website is not super popular and, in my case, it's pretty simple to differentiate between a human or bot.
Hope this helps...
Re: Ask HN: What do people use to prevent crawlers?
#23The other day I've made a Chrome extension for scrapping a protected website. It worked wonderfully, as it simulated a normal user session, bypassing the JavaScript protections the website has. You can also run such scripts with a headless browser for full automation, PhantomJS being an obvious choice. You really can't protect against this unless you start making the experience of regular visitors much worse.
Sure you can protect against this - there are several companies that use machine learning to spot small differences between selenium and real users (mouse delays etc). For example, it might detect that a mouse click is dispatched at exact intervals (and block it). To which you'd think "I'll just add Math.random() * 2000" which it'll easily detect as well. It's _definitely_ doable, but it's not as trivial as recording…
Re: Ask HN: What do people use to prevent crawlers?
#24Otherwise, your best bet (hardest to get around in my experience) is monitoring for actual user I/O. Like if someone starts typing in an input field, real humans have to click on it beforehand, and most bots won't.
Or if a user clicks next-page without the selector being visible or without scrolling the page at all. Not natural behavior.
Think like a human.
Re: Ask HN: What do people use to prevent crawlers?
#25Re: Ask HN: What do people use to prevent crawlers?
#26Re: Ask HN: What do people use to prevent crawlers?
#27I run a cronjob every 5 minutes that parses httpd access log. If there's an IP with abnormally large request number, it blocks it. Most crawlers will make hundreds of requests in five minutes, while legitimate viewers will make be bellow 100.
Re: Ask HN: What do people use to prevent crawlers?
#28I remember working hard on a project for a year, then releasing the data and visualizations online. I was very proud. It was very cool. Almost immediately, we saw grad students and research assistants across the globe scraping our site. I started brainstorming clever ways to fend off the scrapers with a colleague when my boss interrupted.
Him: "WTF are you doing?"
Me: "We're trying to figure out how to prevent people from scraping our data."
Him: "WTF do you want to do that for?"
Me: "Uh... to prevent them from stealing our data."
Him: "But we put it on the public Web..."
Me: "Yeah, but that data took thousands of compute hours to grind out. They're getting a valuable product for free!"
Him: "So then pull it from Web."
Me: "But then we won't get any sales from people who see that we published this new and exciting-- Oh. I see what you mean."
Him: "Yeah, just get a list of the top 20 IP addresses, figure out who's scraping, and hand it off to our sales guys. Scraping ain't free, and our prices aren't high. This is a sales tool, and it's working. Now get back to building shit to make our customers lives easier, not shittier."
Sure enough, most of the scrapers chose to pay rather than babysit web crawlers once we pointed out that our price was lower than their time cost. If your data is valuable enough to scrape, it's valuable enough to sell.
The only technological way to prevent someone crawling your website is to not put it on a publicly-facing property in the first place. If you're concerned about DoS or bandwidth charges, throttle all users. Otherwise, any attempts to restrict bots is just pissing into the wind, IMHO.
Spend your energies on generating real value. Don't engage in an arms racw you're destined to lose.
Re: Ask HN: What do people use to prevent crawlers?
#29https://en.wikipedia.org/wiki/Robots_exclusion_standard
Re: Ask HN: What do people use to prevent crawlers?
#30"How do I stop all these dinner guests from eating this lovely pie I set out on the table?" I remember working hard on a project for a year, then releasing the data and visualizations online. I was very proud. It was very cool. Almost immediately, we saw grad students and research assistants across the globe scraping our site. I started brainstorming clever ways to fend off the scrapers with a colleague when my boss…