Find broken links in websites, markdown files, and HTML documents.
# Scan a website for broken links
python3 scripts/dead_link_scanner.py scan https://example.com
# Scan with depth limit (default: 1)
python3 scripts/dead_link_scanner.py scan https://example.com --depth 3
# Scan a local markdown file
python3 scripts/dead_link_scanner.py file README.md
# Scan multiple files
python3 scripts/dead_link_scanner.py file docs/*.md
# JSON output
python3 scripts/dead_link_scanner.py scan https://example.com --json
# Only show broken links
python3 scripts/dead_link_scanner.py scan https://example.com --broken-only
scanCrawl a website and check all links on each page.
python3 scripts/dead_link_scanner.py scan <url> [options]
Options:
--depth — Max crawl depth (default: 1, 0 = single page only)--timeout — Request timeout (default: 10)--json — Output results as JSON--broken-only — Only show broken links--internal-only — Only check links within the same domain--max-urls — Max URLs to check (default: 200)--delay — Delay between requests (default: 0.2)fileScan local markdown or HTML files for broken links.
python3 scripts/dead_link_scanner.py file <path>... [options]
Options:
--timeout — Request timeout (default: 10)--json — Output as JSON--broken-only — Only show broken linksDefault text output:
✓ 200 https://example.com/about
✓ 200 https://example.com/blog
✗ 404 https://example.com/old-page (found on: https://example.com)
✗ ERR https://dead-domain.xyz (found on: https://example.com) — ConnectionError
Summary line:
Checked 42 links: 39 OK, 3 broken
共 1 个版本