whatisgithub

What is anansi?

mdowis/anansi — explained in plain English

Analysis updated 2026-05-18

61PythonAudience · developerComplexity · 3/5Setup · moderate

In one sentence

A Python scraper that fixes its own broken selectors, mimics a real browser to get past bot blocking, and skips pages that have not changed.

Mindmap

mindmap
  root((anansi))
    What it does
      Self healing scraper
      Adapts to site changes
      Resists bot blocking
    Tech stack
      Python
      Playwright
      SQLite
      Pydantic
    Use cases
      Scrape changing sites
      Extract product data
      Long running crawls
      AI driven crawling
    Audience
      Developers
      AI agent builders

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Scrape a site whose layout changes often without rewriting selectors each time

USE CASE 2

Pull product or article data from JavaScript heavy pages automatically

USE CASE 3

Run a long term crawl that survives restarts and skips unchanged pages

USE CASE 4

Let an AI agent drive a scraping job through an MCP conversation

What is it built with?

PythonasyncioSQLitePlaywrightPydanticMCP

How does it compare?

mdowis/anansialbertaworlds/japanese-corpus-syntactic-analysis-agentblue-pen5805/comfyui-krea2-negpip
Stars616161
LanguagePythonPythonPython
Setup difficultymoderatehardmoderate
Complexity3/54/52/5
Audiencedeveloperresearchergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Browser rendering and TLS fingerprinting need optional extras installed separately (Playwright, curl-cffi).

So what is it?

Anansi is a Python web scraping toolkit built for sites that actively try to block scrapers. The core idea is that the web changes constantly and fights back, so the scraper should adapt on its own instead of breaking every time a page layout shifts. When a site redesigns a page, Anansi does not just fail. It keeps a confidence score for each CSS selector it uses, and if one stops working it tries several backup strategies in turn: matching by the surrounding text, finding similarly named classes, following the structure of nearby elements, or falling back to XPath. Whichever approach works gets remembered for next time. The tool also pulls structured data straight from JSON-LD, Open Graph tags, and Microdata when a page offers it, skipping selector guesswork entirely in those cases. For sites that block bots, Anansi can mimic Chrome's network fingerprint so its traffic looks like a real browser, and it will automatically switch to a real headless browser (Playwright) when a page needs JavaScript to render, including handling Cloudflare style challenges. It also adjusts how fast it crawls based on how many errors it is getting, slowing down after repeated failures and speeding back up once things are clean. Repeat crawls are efficient: Anansi remembers what it already fetched using ETags and content hashes, so unchanged pages are skipped without even loading them again. Extracted data can be checked against a Pydantic schema before it gets saved, catching bad results early. The crawler itself runs on asyncio, stores its queue in SQLite so a crawl can be paused and resumed later, and supports rotating through a pool of proxies. A notable extra is a built in MCP server, which exposes the scraper's fetch, extract, and crawl functions as tools so an AI assistant can run a crawl through conversation instead of writing code. Anansi installs from its GitHub repository with pip, with optional extras for the browser and fingerprinting features. It is still an early project, with 61 stars at time of writing.

Copy-paste prompts

Prompt 1
Help me write an Anansi Spider in Python that extracts product name, price, and rating from a page.
Prompt 2
Show me how to enable the browser fallback in Anansi so it renders JavaScript heavy pages.
Prompt 3
Write a Pydantic item_schema for Anansi that validates scraped article data.
Prompt 4
Explain how to resume a paused Anansi crawl using Crawler.resume.
Prompt 5
Set up the Anansi MCP server so I can run a crawl by chatting with an LLM.

Frequently asked questions

What is anansi?

A Python scraper that fixes its own broken selectors, mimics a real browser to get past bot blocking, and skips pages that have not changed.

What language is anansi written in?

Mainly Python. The stack also includes Python, asyncio, SQLite.

How hard is anansi to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is anansi for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.