A Python script that scans a website and detects broken links.
The tool extracts all links from a webpage, checks their HTTP status code, and reports whether they are working or broken. Results can also be exported to a CSV file.
- Extracts all links from a webpage
- Detects broken and working links
- Shows HTTP status codes
- Displays a summary report
- Optional CSV export of results
- Python 3.8+
Install dependencies:
pip install -r requirements.txtRun the script:
python link_checker.pyEnter a website URL when prompted:
Enter website URL: https://example.com
--- Link Checker Tool ---
Fetching page: https://example.com
Found 25 links.
STATUS URL
------------------------------------------------------------
✔ OK https://example.com/about
⚠️ Redirect https://example.com/docs
❌ Not Found https://example.com/old-page
SUMMARY
--------------------
Total Links: 25
Working: 23
Broken: 2
After scanning, you can save results to a CSV file:
Save results to CSV? (y/n):
A report like this will be generated:
link_report_20260307_143210.csv
MIT License