Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kaltsoon/dead-link-checker
💀 A dead-simple way (pun intended) to recursively look for broken links on a web page
https://github.com/kaltsoon/dead-link-checker
cli docker python
Last synced: about 1 month ago
JSON representation
💀 A dead-simple way (pun intended) to recursively look for broken links on a web page
- Host: GitHub
- URL: https://github.com/kaltsoon/dead-link-checker
- Owner: Kaltsoon
- License: mit
- Created: 2021-10-15T14:37:07.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-06-02T11:29:34.000Z (over 2 years ago)
- Last Synced: 2023-04-06T05:12:19.668Z (almost 2 years ago)
- Topics: cli, docker, python
- Language: Python
- Homepage:
- Size: 62.5 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 💀 Dead Link Checker
[![Test](https://github.com/Kaltsoon/dead-link-checker/actions/workflows/test.yml/badge.svg)](https://github.com/Kaltsoon/dead-link-checker/actions/workflows/test.yml)
A dead-simple way (pun intended) to recursively look for broken links on a web page. Link is considered broken if its URL responds with an HTTP error status code or sends no response. Link with an [URI fragment](https://en.wikipedia.org/wiki/URI_fragment) is considered broken if there's no target for the fragment on the corresponding page.
## Requirements
Python version 3.9 or later.
## How to use?
With Docker:
1. Run the container by running `docker run --rm -v /path/to/data:/usr/src/app/data kaltsoon/dead-link-checker --url ` with the desired URL. Once the script is finished, it will write a report to the `/path/to/data/report.json` file which contains broken links per URL. Note that the script will only go through the internal links to avoid things getting out of hand. Run `docker run --rm kaltsoon/dead-link-checker --help` to see available options.
Without Docker:
1. Create a virtual environmennt by running `python3 -m venv env` and activate it by running `source env/bin/activate`.
2. Install dependencies inside the virtual environment by running `pip3 install -r requirements.txt`.
3. Inside the virtual environment run `python3 src/index.py --url ` with the desired URL. Once the script is finished, it will write a report to the `data/report.json` file which contains broken links per URL. Note that the script will only go through the internal links to avoid things getting out of hand. Run `python3 src/index.py --help` to see available options.