Haldwani Times
Haldwani Times
Technology

findbrokenlinks added to PyPI

findbrokenlinks added to PyPI
Photo / Illustration: Haldwani Times Editorial Desk

Skip to main content Switch to mobile version findbrokenlinks 1.0.0 Async broken-link crawler with pluggable checks and reporters

pip install findbrokenlinks Copy PIP instructions

Async crawler that finds links on a website whose behavior in a browser would not match user expectations: 404s, network failures, redirects to weird places, "soft 404" pages where a CMS returns 200 but says "not found".

Built around pluggable checks and reporters — adding a new control or output format means dropping a file with an @register decorator. No core edits needed.

Crawl modes: page (single page), internal (same domain), or internal+external (recurse internal, validate external) — --mode.

Seven built-in checks — flag HTTP errors, network failures, redirect chains, redirects to the home page, two soft-404 detectors (regex patterns + baseline probing), and an anti-bot block detector so WAF challenges from Cloudflare / DataDome / PerimeterX / Imperva / Akamai / DDoS-Guard and login walls (401) don't masquerade as broken links.

Polite-but-well-formed HTTP: keeps an honest User-Agent, but pairs it with standard Accept and Accept-Language headers so WAFs don't treat us as malformed traffic.

Doesn't parse JS as HTML: bodies are only HTML/plaintext; JS, CSS, JSON aren't read, and HTMLExtractor double-checks Content-Type before invoking bs4 — so JavaScript string literals can't become fake findings.

Nine output formats: csv, tsv, json, jsonl, html, markdown, junit (XML), sarif, grouped-json. Emit multiple at once with --format a,b,c.

grouped-json reporter collapses findings by final_url — one record per distinct broken target with the source-page list preserved as a count plus a small sample. On a real crawl of a 7800-page site, a single broken footer link generated 7800 findings; grouped-json compresses that to one record (97% reduction in our test case).

Incremental report writing: when a single streamable format is selected (csv, tsv, jsonl), each finding is appended to the output as soon as it is discovered — you can tail -f the report while the crawl runs.

Polite by default: respects robots.txt, rate-limited (token bucket), bounded concurrency, configurable timeouts and redirect caps.

Bandwidth-efficient: streams responses — binary content (PDFs, archives, images) is never downloaded, only its status code is checked. Text bodies are capped (default 1 MB) so a runaway HTML page can't exhaust memory.

HTML coverage beyond : also checks News illustration,