Live data from Hacker News

Ask HN: What do people use to prevent crawlers?

news.ycombinator.com

21–30 of 123 posts

Re: Ask HN: What do people use to prevent crawlers?

#21
post #18

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…

Also - We've served fake data and honey pots (invisible to a real user) a lot of times in order to detect what sites "reuse" our data and sue them :)

Re: Ask HN: What do people use to prevent crawlers?

#22
I've built crawlers that retrieve billions of web pages every month. We had a whole team working modifying the crawlers to resolve website changes, to reverse engineer ajax requests and solve complex problems like captcha solvers. Bottom line, if someone wants to crawl your website they will.

What 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?

#23
post #19
post #9

The 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…

IF you throttle the connection then wouldn't download time and network latency, etc., give you a better random?

Re: Ask HN: What do people use to prevent crawlers?

#24
If you're getting a lot of crawler traffic, your site probably has information a lot of people find useful, so you should consider finding a way to monetize it.

Otherwise, 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?

#25

If it's about content, SVG and convert all text to curves. /s

Can just screencap the rendered page and use OCR. If someone wants to scrape your website badly enough, they'll find a way.

Use a really bad font with terrible kerning and very similar 1lI and oO0, etc.. /s

Re: Ask HN: What do people use to prevent crawlers?

#26
My favorite thing was to identify bots and instead of blocking them, switch to a slightly scrambled data set to make the scrape useless but look good to the developer who stole it. It was a ton of fun as a side project. I'd also suggest you add some innocent fake data to your real site and then set up google alerts of all of the above to catch traffic. About 50% of sites would respond positively to an email when you showed them they were hosting fake data. About 90% would take my data down if that was followed up with a stronger C&D. One key is to catch them fast, while they're still a little nervous about showing off their stolen data online.

Re: Ask HN: What do people use to prevent crawlers?

#27
post #17

I 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.

This is ineffective and dangerous where ISPs allow switching dynamic IP addresses with no delays. Large german ISPs do this, so your abusive scraper will just continue with a new IP address while some legitimate user, who is unlucky enough to get the abuser's old IP address, is blocked.

Re: Ask HN: What do people use to prevent crawlers?

#28
"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 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?

#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…

Exactly. If you have data so valuable that people want to take it, it's going to be a lot easier to figure out how to sell it to them (they're probably not professional web scrapers, it's just a means to an end.) Than to waste yours, theirs and everyone else's time going tit-for-tat keeping them away from your data.
Post reply on HN