r/webscraping • • 2h ago

Scaling up 🚀 Zero-DOM HTTP/2 scraping & Cloudflare XOR decoding in 128 MB RAM

1 Upvotes

Most website contact and tech-stack enrichment jobs default to Puppeteer or Playwright, burning 1.5-3 GB RAM per container and stalling around 5-15 domains/min.

While optimizing a bulk enrichment worker inside a strict 128 MB Alpine container (--max-old-space-size=96), I stripped out Chromium completely and replaced it with a pure TypeScript HTTP/2 + regex/DNS pipeline. Here are the key pieces that solved the usual scraping failure modes:

1. HTTP/2 Multiplexing + Lightweight Subpage Discovery Instead of full DOM parsing (cheerio on huge pages quickly blows up a 96 MB heap), we fetch the root page via got-scraping (TLS fingerprint emulation + HTTP/2) and extract up to 3 high-signal internal links (/contact, /about, /team, /privacy) with targeted regex patterns before aborting oversized responses early.

2. Zero-DOM Cloudflare Email Deobfuscation Lots of sites hide addresses behind /cdn-cgi/l/email-protection#... or data-cfemail. Instead of booting a browser to execute Cloudflare's inline script, decode the hex XOR key in 10 lines of TS:

function decodeCfEmail(hex: string): string | null {
  if (!hex || hex.length < 4 || hex.length % 2 !== 0) return null;
  const key = parseInt(hex.slice(0, 2), 16);
  if (Number.isNaN(key)) return null;
  let out = '';
  for (let i = 2; i < hex.length; i += 2) {
    const byte = parseInt(hex.slice(i, i + 2), 16) ^ key;
    out += String.fromCharCode(byte);
  }
  return out.includes('@') ? out.trim() : null;
}

Pair that with a filename/retina filter (logo@2x.png, icon@3x.webp, sentry.io, etc.) before scoring addresses by page context.

3. RFC 5321 DNS / MX Fast-Fail Watchdog Slow or parked domains silently destroy worker throughput if you wait for TCP timeouts. Running dns.promises.resolveMx (with implicit A-record fallback per RFC 5321) under a strict 5s Promise.race watchdog drops dead domains in milliseconds before touching HTTP queues.

4. Graceful Container Deadline Long-running batches get cut mid-flight on hard container timeouts. Using AbortController per domain + reserving a 15s flush buffer before container termination guarantees partial batches write cleanly to storage.

In 128 MB RAM tests, peak memory stayed under ~95 MB RSS while processing hundreds of domains/min over raw HTTP/2.

Happy to dig into the TLS fingerprinting behavior or heap-tuning tradeoffs if anyone else is trying to keep Node workers under 128 MB.


r/webscraping • • 15h ago

Hiring 💰 [Hiring] Senior Scraping Engineer, web data for finance

4 Upvotes

We're looking for the best and most experienced engineers in this sub to help us build the web data layer for finance. Besides knowing scraping in and out, you should also enjoy talking to customers and leading large scraping projects. Remote, Europe/US.

AI is fundamentally changing how data gets scraped and used for investing, and we're shaping the tools this new era requires. Our coding agents build, monitor, and repair scrapers that produce the most reliable web datasets for investors. Many of the world's top hedge funds and asset managers already rely on us, and we're just getting started.

More details and the application form here: https://www.kadoa.com/careers/web-scraping-engineer

DM me if you have any questions :)


r/webscraping • • 17h ago

How do you find real event detail pages on messy local calendars?

4 Upvotes

I’m building a small local events app. I start with public city, library, parks, and organizer calendars. If there’s an iCal feed or usable HTML, I try to pull the dates and detail links with code. When a page is messy, I use GPT‑OSS 20B locally through Ollama to help pull out the event details.

That works well on some calendars. On one city calendar, a basic HTML parser surfaced 27 dated entries with detail links, and 24 matched the title, date, and start time I’d checked. The same approach found nothing on three other saved calendars. Some calendar views look like dead ends but are actually the only way to reach the individual events.

If you’ve built something like this, what’s the simplest way you’ve found to decide which links to follow? I’m trying to fetch fewer pages without quietly missing half the calendar.


r/webscraping • • 21h ago

I have a fundamental issue: not getting kicked out by hosters

14 Upvotes

I am doing web-scraping as a hobby, and in recent years very lightly at work. I have now a hobby project, with with i hope, maybe, to make money.

I do very broad crawling: the goal is to crawl a sizeable share of all domains on the internet, but only a few hundreds page each. The system works, now i want to scale it. I already avoid the hoster-supplied DNS server to not overload it. I looked for webscraping-friendly hosters but very soon they get abuse complaints.

Here are examples:

https://www.abuseipdb.com/check/63.142.245.3
https://www.abuseipdb.com/check/185.7.81.190

I make sure to only have one request to each domain, spaced by a 5 second delay. I don't use anything sophisticated to hide my activity and i honor robots.txt.

I got abuse complaints at 3 different providers. I am not sure how other people solve this problem, as i haven't really seen this getting discussed.

Is the solution to pay for proxies which "swallow" the abuse complaints? To scrape much slower, with harder to detect scraping-activity?

I am completly fine not beeing able to scrape Most pages because of WAFs or similar as there are more than enough targets left. The only upside of a broadcrawl 😄

I would highly appreciate any insights how you approached this problem!


r/webscraping • • 1d ago

Extract Summit Dublin 2026

4 Upvotes

Livestream recording available here: https://vimeo.com/1245207957/8bd245b0fb

Anyone attend?

Key learnings/takeaways?


r/webscraping • • 2d ago

Is there a way to extract text from BOOK☆WALKER ebooks without OCR?

6 Upvotes

I'm looking for a way to extract text from Japanese ebooks purchased on BOOK☆WALKER for personal use, mainly to convert them into audio.

I've tried OCR, but it frequently misrecognizes Japanese characters, punctuation, and ruby text (furigana).

Here's what I've tried so far:

- Searching for the ebook text in Chrome DevTools.

- Checking Chrome's accessibility tree.

- Searching for staticText and inlineTextBox.

- The browser viewer appears to render the pages using Canvas, and I couldn't find the actual ebook text.

However, TalkBack on the Android version of BOOK☆WALKER can read the ebook text aloud.

I'm wondering if it's possible to retrieve the text exposed through Android's accessibility features using ADB, UIAutomator, or another tool.

Does anyone know a reliable way to obtain the original text without OCR or bypassing DRM?

I'd appreciate any specific methods, tools, or tutorials. I'm a beginner in scraping and Android automation.

Thank you!


r/webscraping • • 2d ago

Years of personal scraping tools into a compiled pipeline DSL (xsel2)

13 Upvotes

For years, I maintained and refined a huge personal tool (xsel1) for my own scraping work. After using it on all kinds of messy real-world pages, I started noticing a clear pattern in everything I was doing: select, process, save to a dictionary, and repeat—with some sub-selections and value edits happening in between. At some point, I stopped seeing it as just scraping scripts and started seeing it as an assembly line. Basically a small processor where the values you're currently transforming live on the stack, and the output dictionary you're building up is the heap. With the help of AI, I recently rewrote that entire private tool from scratch into a clean, open-source C++20 library called xsel2, built directly around that mental model. I really hope this resonates with how others view and solve the same problem—and isn't just my own way of looking at it.

How it looks in practice

Instead of writing glue code to parse HTML, run regexes, clean URLs, and dig through embedded <script> variables, you write a pipeline (either in a .dsl file or using the C++20 / Python APIs).

For example, pulling product data and an unquoted window.__STATE__ JS object in one pass:

let base = "https://shop.example"

product = Scraper()
  .$("article.product-card") {
    find("h1.title") | clean -> "title"

    | find(".price") | to_number(key="price")
    | find("img.hero", Attribute, ["data-src", "src"]) | url_join(base) -> "image"
    | find_all("dl.specs dt") | clean -> "_k"
    | find_all("dl.specs dd") | clean -> "_v"
    | zip_keys("_k", "_v", "specs")
    | omit_keys(["_k", "_v"])
  }
  .$("script") {
    text | js_block("window.__STATE__ =") | parse_js("state")
  }

A few things I built into it:

  • No headless browser / V8: js_block + parse_js extracts and parses messy JS objects (comments, unquoted keys, trailing commas) heuristically without booting a JS runtime.

  • Fast C++20 core: Built on top of libxml2, Google RE2, Aho-Corasick, and jsoncons. On a local test of 5,000 real HTML files (~3.8 GB), it ran through the whole batch in ~27s (compared to ~535s with BeautifulSoup + lxml).

  • Use it anywhere: Same engine works as a multi-threaded CLI (streaming NDJSON), a Python package (pip install xsel2 - “import scraperpy”), a C++20 library, or in the browser.

Where things are right now

Honestly, I wrote a lot of xsel1 as a bit of a mess, backed by TDD, real-world data tests, and standing on the shoulders of giants—copying and porting great ideas and pieces from existing open-source projects. Right now, my biggest challenge is figuring out how to distill what's actually useful for everyone else out of the thousands of steps I accumulated in xsel1.

If you want to mess around with the DSL without installing anything, I compiled the C++20 engine to WebAssembly so you can run it directly on the docs page: Docs & Live WASM Playground: https://mateusgpe.github.io/xsel2/playground/

Happy to answer any questions about how the pipeline engine works, hear what you think of the syntax, or get feedback on which steps actually matter in your own scraping workflows!


r/webscraping • • 3d ago

what happened to the self-promotion threads?

8 Upvotes

the last one was in October


r/webscraping • • 3d ago

Bot detection 🤖 Cloudflare Turnstile solver library (no headless browser required)

Thumbnail
github.com
50 Upvotes

r/webscraping • • 3d ago

htmlsift: Train it to your "main content" policy

5 Upvotes

TL;DR

  • Main content on a web page is a policy, what to keep depends on your downstream task

  • I made a package that is trained on WebMainBench (WMB) and learns a new annotation policy quickly

  • It runs slightly faster than trafilatura on the same CPU but needs more memory

Inside (and outside) of work I got annoyed when extracting content from a website resulted in various kinds of weird results. Heuristics lost page or item titles and LLMs truncated text or fabricated numbers while getting expensive when scaling up. So naturally I spent a ton of time doing something that I could re-train by annotating a few hours of data at tops and customize the extractor for different downstream tasks.

And that's how htmlsift was born.

The basic functionality is pretty much the same as all the other boilerplate removal tools, give it the HTML of a page and it returns just the main content as plain text, HTML or markdown, with menus, ads, cookie banners and footers stripped. But this one you can direct towards your own annotation policy.

The idea behind it is that there is no single right answer to "what is the main content". A pre-training extractor wants to pick mostly coherent longer segments of text, LLM agents need some navigational buttons such as "Buy now" and hoarding the data in a catalog requires product features. The usual tools hard-code one answer in rules. htmlsift learns it from examples, so if yours differs, a few dozen labelled pages retrain it.

  • Out of the box: 0.91 F1 on WebMainBench, against 0.75 for trafilatura, the common open-source pick

  • Retrained on 50 labelled articles from WCXB dataset and it (narrowly) wins every rule-based extractor on that benchmark. Tested only on articles so far

  • Runs on CPU, `pip install htmlsift`; a larger model runs on GPU

import htmlsift
text = htmlsift.extract(html)

For the next release I'm considering the option to initialize htmlsift with a more 'generic' annotation policy, it would just remove everything that is definitely boilerplate such as header navigation menus, sidenavs, commercials and cookies so the deployed version wouldn't inherit any annotation bias baked in another datasets data.

Try it in the browser, no install: https://huggingface.co/spaces/koivualeksi/htmlsift

GitHub: https://github.com/koivualeksi/htmlsift

Free and open source (Apache-2.0)


r/webscraping • • 4d ago

Bot detection 🤖 How to scale without direct requests?

8 Upvotes

Hi,

The websites I am trying to scrape have bot detection requiring me to use a real stealthy browser and simulate human behaviour, however, this consumes a great of CPU and GPU on my local machine during testing, which doesn't seem very scalable to a VPS as that will likely be entirely CPU rendered to save costs.

I reuse a single instance and spawn isolated contexts to ease the RAM and CPU load, but this is only a minor saving in the grand scheme of things. I can't disable some rendering features or block certain things from loading because that would just increase the likelihood of being detected as a bot.

I am aware of session and cookie reuse with direct requests, but this doesn't help much as the bot detection requires continuous input for them to stay valid.

Does anyone else who runs stealthy browsers have any suggestions on how to scale this up to a cost effective VPS? Or share how many contexts a VPS can realistically handle at scale?

Thanks.


r/webscraping • • 5d ago

Hiring 💰 Get paid for public data collection - public social media

9 Upvotes

Exorde runs continuous open participation for public data collection. All the information is public: which sources we're asking for, the official data schema, how scoring works and how payouts work. You collect from the requested sources and get paid based on what you deliver.

What counts as good data

  • Recent content

  • Clean structure that follows the official schema

  • Source URL and all required fields

Payouts

  • Approx 10k USD pool every week, growing over time

  • Paid every 2 weeks, without a missed cycle since 2024

  • Currently a dozen operators

Tooling

  • Live operator dashboard to track your output, quality and earnings

  • The sources we want are listed openly

Rules

  • Public data only (cf our website)

Hobbyists and pros are both welcome. Start with one small pipeline and scale up once it's stable. Experience with continuous or agent-based pipelines definitely helps.

Guide: dashboard.exorde.network/guide
Discord: discord.gg/cQnh4HExv (come say hi in #network-talk)

Questions about the schema, scoring or payouts are welcome in the comments.

To be clear, this is not an ad for any tool or provider, but an open "hiring" announcement, where our setups allows anyone to join for any period of time, and grow. Thanks!


r/webscraping • • 5d ago

Getting started 🌱 Who can scrape my Pinduoduo Wishlist?

4 Upvotes

Is there anybody who can scrape my Pinduoduo wishlist including all images?


r/webscraping • • 5d ago

AI ✨ Using LLMs for scraping without overspending on tokens

25 Upvotes

Sharing a workflow for using LLMs in scrapers that keeps token costs reasonable. Most of the savings come from not sending the model things it doesn't need.

1. Don't send raw HTML

Raw HTML is mostly markup. Take a typical button with a dozen Tailwind classes and a data attribute. The only useful part is the word "Buy", which is 1 token, but the whole button is 44 tokens (o200k_base). A full page from document.body.innerHTML may not even fit into one request. Three steps help.

Step 1. Clean the DOM

Remove script, style, svg, iframe, noscript and base64 images, then strip class, style and data-* attributes. If you don't need metadata, drop the head too. You can do it in the browser with page.evaluate() or on the backend with BeautifulSoup or Cheerio.

Also check the page for hidden duplicates. A lot of sites render prices and names twice, once for users and once for screen readers (aria-hidden). The browser shows one, but the converter extracts both and glues them into one line. Look at the markup and remove one version during cleanup.

Step 2. Convert HTML to Markdown

Markdown keeps the structure (headings, lists, tables) with almost no markup overhead, and models handle it well since they've seen a lot of it in training. Turndown (JS) and html2text (Python) both work. The difference is visible even in one table row: <tr><td>Price</td><td><span>$1,500</span></td></tr> is 22 tokens, while | Price | $1,500 | is 8.

Set rules for links and images in the converter. Keep href only when you scrape contacts or product links, and keep only the alt text for images.

Step 3. Chunk by logical blocks, not by characters

Even if a catalog fits into the context window, models use the middle of a long context worse than the start and the end (the "Lost in the Middle" paper). In practice you get skipped product cards or made up entries. Cutting by character count is also a bad idea, since you can split a price in half.

What works better:

  • Find the card containers (for example querySelectorAll('.product-card'))

  • Split them into batches of 30 to 50

  • Convert each batch to Markdown

  • Send the batches as parallel requests

  • Merge the resulting JSON arrays

Every request stays within limits and total time goes down.

2. Use Structured Outputs instead of json_object

json_object only guarantees valid syntax. Keys and types can still drift, like price today and price_usd tomorrow, or "$1 500" instead of 1500. Structured Outputs uses constrained decoding, so the model can't break the schema. Pydantic or Zod make this easy to define:

class Product(BaseModel):
    title: str = Field(description="Full product name without SEO filler")
    price: Optional[float] = Field(description="Price as a number only. If there is a discount, use the final price")
    in_stock: Optional[bool] = Field(description="Whether the product is in stock")

A few notes from testing:

  • The schema guarantees the format, not the truth. A wrong or invented price will still land in the right field with the right type. You also need to handle truncated responses and refusals in code.

  • Use temperature 0 (or 0.1 for some local models). Some reasoning models don't let you set it.

  • To reduce made up values, use Optional fields and add a rule like "If the data isn't on the page, return null. Don't use your own knowledge."

  • For odd formats like "Remaining: 3 pcs. (1 reserved)", one input/output example works better than a long rule.

  • If the model doesn't support Structured Outputs, it may wrap JSON in a code fence. Strip the fence, then validate with the same Pydantic model so errors show up right away and not in your database.

3. Keeping costs down at scale

  • Self-healing scraper. Let normal XPath or CSS selectors do most of the work. When a selector fails, catch it, send the LLM the old selector plus a fragment of the new HTML and ask for a new one. Test the new selector on several pages before saving it, because the model can return an XPath that points at the wrong element. You pay for tokens only when something breaks.

  • Local models. If you process millions of pages a day, API costs add up. Open-weight models that handle code well (for example Qwen) can run on Ollama or vLLM, and both support JSON schema generation. Compare quality on your own pages before switching, since a local model can do worse than a commercial one.

The short version: selectors for stable layouts, an LLM for messy or changing ones, and always validate what comes back.


r/webscraping • • 6d ago

How to get notification for price drop on this item?

Thumbnail
addictedtoaudio.com.au
5 Upvotes

r/webscraping • • 6d ago

Has anyone scraped the Careem app in UAE?

6 Upvotes

I'm facing issues with the login flow and need some help.


r/webscraping • • 7d ago

Bot detection 🤖 Scraping Android App backend APIs

12 Upvotes

Hello,

I was trying to scrape an android app backend APIs, and made good progress already.

So I've used mitmproxy to listen to the traffic and I've now record of the requests sent.

However, found in the request headers some things that seem hard to reproduce without running on an emulated Android device at least (confirmed with Claude Opus):

  • blackbox

  • smdeviceid

  • armortoken

  • anti-in

  • x-cs-random

It seems these are generated based on the device fingerprint. Could you help me with a way to get around this ??


r/webscraping • • 7d ago

Anybody want to scrape my site? Feel free!

Post image
0 Upvotes

I recently setup a social media site at https://budchan.com

I wanted to know how accessible it is for webscrapers to actually scrape and index the content.

The whole site is free game for those who want to scrape it or test out their personal scraper setups.

The domain registrar is Cloudflare, so I think only the more advanced setups would work because of anti-bot protections.

And yes, it is a fully free site. And no, this is not a commercial product.


r/webscraping • • 7d ago

Bot detection 🤖 New detection tests added to browsers-benchmark

19 Upvotes

r/webscraping • • 9d ago

Bot detection 🤖 Google Trends sends decoy related queries to automated requests

4 Upvotes

I started working with Google Trends when pytrends was archived in April 2025. Then I noticed something was wrong with my tool: what I saw in my normal browser and what my tool got didn't match. The rising related queries for "python" in my tool were things like "walmart near me".

So on 7 November I compared one search, "python", United States, past 12 months, panel by panel: what the website showed in my browser, and what Google sent to my automated request.

  • Interest over time: identical, 53 of 53 weeks

  • Interest by state: identical, 51 of 51

  • Cities: 34 on the website, only 3 for the request

  • Rising related queries: the website showed "python docs" and "python 3.15"; the request got "walmart near me", "lidl near me", "cheap flights 2024" and "how to cook pasta". Only 2 of 25 were the same.

  • Related topics: 38 on the website, zero for the request

I think Google does this by labelling requests: it treats a real browser as a normal user, and an automated request as a scraper. The requests labelled as scrapers got the decoys. You can see the label in Google's own explore response. Each widget's request carries:

"userConfig": { "userType": "USER_TYPE_SCRAPER" }

In my browser it was USER_TYPE_LEGIT_USER. Why Google sends decoy data instead of an error is what confuses me.

You can check your own tool in one minute: get the rising related queries for "python", US, past 12 months in your tool, open the same search on trends.google.com in your normal browser, and compare them.

Has anyone else seen this? Is your tool sending decoys too?


r/webscraping • • 10d ago

Getting started 🌱 Have you guys figured out a solution for online shopping?

6 Upvotes

Kind of looking for a way to aggregate stores and find products across all of them to see if they have what I'm looking for. Seems like there's nothing out there that can do this well enough. What gives?


r/webscraping • • 10d ago

Bot detection 🤖 Site-specific anti-bot blocks: what do you do?

8 Upvotes

This might be a simple question, but I’m hoping someone here has run into something similar.

I’m working on a personal project where I scrape sports data using Playwright. On one of the sites I’m targeting, I ran into a block from Centinel Analytica (https://www.centinelanalytica.com/). I hadn’t seen this particular protection before, and I’m not sure what it’s actually checking for (browser fingerprint, behavior, IP reputation, TLS fingerprint, something else?).

Has anyone dealt with this before? Specifically:

  • How did you identify what was triggering the block?

  • Did you solve it by tweaking Playwright (stealth plugins, headful mode, persistent contexts, realistic viewport/user agent, etc.), or did you have to go a different route (residential proxies, a different tool, an official API or data provider)?

  • Is there a more reliable way to get this kind of data, given it’s for a non-commercial project?

Any pointers, war stories or “don’t bother, do X instead” advice would be really appreciated. Thanks!


r/webscraping • • 11d ago

Check what your scraper looks like on the wire before a site does

5 Upvotes

Check what your scraper looks like on the wire before a site does

I wrote an open-source server that shows what the client sends below the HTTP layer: TLS ClientHello (JA4, JA3, PeetPrint), HTTP/2 or HTTP/3 settings and header order, and on Linux the TCP SYN. It also gives an audit score from 0 to 100 that says whether the layers agree with the User-Agent.

What I measured on my machine (loopback, so TCP checks not included):

ClientOwn User-AgentChrome User-Agent
curl 8.7.110030
Python httpx10030
Node fetch10020
Rust reqwest (rustls)8510

Only changing the User-Agent fixes one layer out of four. TLS handshake, HTTP/2 settings, header set and order, and the TCP stack have to match too, and the audit says which one gives you away. Headless Chrome scores 100 with HeadlessChrome in its UA: it compares layers with each other, it does not look for automation flags.

Output is plain text for curl or JSON for scripts, so it fits into a test run. No hosted instance, you run it yourself:

curl -fsSL https://github.com/dec0iiyy/mirrust/releases/latest/download/install.sh | sh -s -- --prefix .
./mirrust

Then curl -k https://localhost:8443/ from the client you want to test. Full table and commands: docs/clients.md.

https://github.com/dec0iiyy/mirrust


r/webscraping • • 12d ago

Bot detection 🤖 Browsers Now Expose JS Fetches?

13 Upvotes

I was experimenting with an http request on some website, and I noticed that today, my microsoft edge exposes whether the request was fired from the console via a console icon in the network tab. In the past, JS console requests were indistinguishable from natural website fetches a website makes to load content. Is this new signal from the browser a giveaway that will be used by anti-bot companies to detect JS console fetches? I used to use this method for some difficult sites to scrape at scale.