Live data from Hacker News

Avoiding bot detection: How to scrape the web without getting blocked?

github.com

191–200 of 312 posts

Re: Avoiding bot detection: How to scrape the web without getting blocked?

#191

Google "residential proxies for sale" if you want to see the weird shady grey market for proxies when you need your traffic to come from things like cablemodem operator ASNs' DHCP pools

I’ve been using some of these for a shoe bot that I’m working on. They are pretty hit or miss.

Re: Avoiding bot detection: How to scrape the web without getting blocked?

#192
post #19

Datadome, PerimeterX, anyone tried ine if them?

I’ve tried skirting datadome but generally you can just get around it by rotating ips, apparently there is a way to de-obfuscate their apps (apps that use datadome services) to retrieve datadome cookies but I haven’t been bothered to check it out yet.

Re: Avoiding bot detection: How to scrape the web without getting blocked?

#193
post #155

Earlier quoted context omitted.

thats great till you're in a foreign country and your phone suddnely decides to die leaving you stranded and unable to access bank accounts or prove your identity. (happened to me)

2FA isn't limited to one device, or specific 2FA mobile apps. For example I use oathtool for most 2FA things; you just need to store the secret (often in the form of a QR code, but many services will also offer a text version, and if not you can decode the QR). 100% reliance on a phone which is easily lost, broken, stolen, etc. without backup is really bad IMO. My bank (Revolut) only had a mobile app, and no way to c…

This is becoming the standard now. Can only contact certain corporations through their mobile app, not through their web site (even if logged in).

Re: Avoiding bot detection: How to scrape the web without getting blocked?

#194

Earlier quoted context omitted.

> On the contrary, there are no laws that say you can't scrape a site. You are both wrong: copyright law both says you can't (in some cases for some uses) and that you can (under implicit license, fair use, and other rules) in others.

Depends on what exactly is being scraped. If it's something like price data or exact values then it isn't protected by copyright at all.

Price data can be protected by copyright as a compliation of data.

https://www.bitlaw.com/copyright/database.html

Re: Avoiding bot detection: How to scrape the web without getting blocked?

#195
post #137

Earlier quoted context omitted.

I have a considerable amount of experience in the industry. Some of these so-called "advanced" techniques: * We use our own mobile emulation software (similiar to bluestacks). Turns out, mobile helps with a lot of things (below). * We use mobile IPs only. Mobile LTE data users are behind CGNATfor IPV4. You can't block one ip without possibly blocking hundreds of innocent IPs using the same exit point. * All you need…

This list is pretty interesting. If you don't mind me asking, what do you work on that you requires such sophisticated stuff? Also, does this work only for browsers or also for mobile apps? I have always assumed that it is always theoretically possible to get data from browsers (very extreme resort is save the browser page / (screenshot + computer vision)); but it can be impossible to get data from apps (especially i…

Mobile IPs will be a problem until the entire Internet is IPv6. The issue is that there are not enough IPv4 addresses for everyone to get their own IP every time their phone connects to the Internet. So the mobile networks use one IP for many handsets. Block the IP, block dozens of different (innocent) people.

Once we're all on IPv6 we can go back to blocking IPs. But then IPv6 creates its own problems.

Re: Avoiding bot detection: How to scrape the web without getting blocked?

#196
post #136

Earlier quoted context omitted.

Unfortunately, the days of reliable non-JavaScript capable scraping are over. Fortunately there are plenty of tools to handle this, and at a hobby level not particularly resource intensive. Something like this is simple and reliable in many cases: https://github.com/berstend/puppeteer-extra/tree/master/pack...

> Unfortunately, the days of reliable non-JavaScript capable scraping are over. Not really. In a lot of cases websites use JavaScript to call some API along with some on the fly generated token to prevent abuse. As long as that token isn't captcha you can reverse engineer the site to do scraping without javascript and that is so much faster than browser based scraping.

I don't think token is only the thing it comes to play here. If the company wants they can use various other techniques like fingerprinting, tls fingerprinting and lot of thing.

Its just a cat and mouse game. After few year I think hardware attention etc will come to play which can mitigate bot issue somewhat.

Re: Avoiding bot detection: How to scrape the web without getting blocked?

#197
post #133

Earlier quoted context omitted.

Have you considered using Playwright to automate that instead?

I had never heard of this, but it looks like a reasonable option. My go-to for this type of thing would be Python+Selenium+Firefox, but only due to familiarity with those.

I spent a lot of time writing lots of Selenium bots 5-6 years ago, but Playwright is way way way better. It's absolutely worth trying out. You'll never go back.

Re: Avoiding bot detection: How to scrape the web without getting blocked?

#198

Another great resource is incolumitas.com. A list of detection methods are here: https://bot.incolumitas.com/ I run a no-code web scraper ( https://simplescraper.io ) and we test against these. Having scraped million of webpages, I find dynamic CSS selectors a bigger time sink than most anti-scraping tech encountered so far (if your goal is to extract structured data).

Can your scraper be used to scrape images? I need to scrape some books from a paywalled site and they are presented a page at a time. The JS code is too complex for me to bother trying to figure out how it creates the unique tokens it applies to every image it displays to avoid a very simple scrape.

Re: Avoiding bot detection: How to scrape the web without getting blocked?

#199

A lot of web scraping is annoying often because there’s *an explicit API built for the scrapers needs*. Instead of looking for an API, many think to first use web scraping. This in turn puts load and complexity on the user facing web app that must now tell scraper from real users.

But if there's an API, then the overall load is the same, no? Or to put it another way, naively, having api.example.com and realpeople.example.com separated out into separate sandboxes seems reasonable, but due to the aforementioned problem, its not. But then it also turns out to be the wrong axis for this anyway, and you need your monitoring to work for you.

No, the load isn't the same because the web page might be a multi-megabyte monster piece of badly-coded HTML that returns only say 10 out of 1,000,000 results and needs to be paged through, where the API might return all the million results in a nice JSON chunk.

Re: Avoiding bot detection: How to scrape the web without getting blocked?

#200
post #54

Earlier quoted context omitted.

Not anymore. Now it’s mobile IP addresses.

This! Mobile IPs are far more lucrative. Many services will drop captchas and other anti-bot stuff for consumer mobile IPs. I recall Plaid at some point would run their bank scraping through mobile IPs. This sketchy company lets mobile app developers monetize user base by letting other people pay $$ to route requests through random people’s mobile IPs: https://brightdata.com/

This is really bad. Imagine if someone plants these proxy inside app how user are even going to know? I think every OS should come with firewall so if app tries to make connection it should prompt with Accept | Accept Forever | Deny | Deny Forever.

I think these companies used to go for extension developer now it seems they have found new idea to implant malware on apps which is not easy to detect.

Post reply on HN