Skip to main content

Checks static .html files for bad links

Project description


Recursively scans directories for static html files for bad or empty links. See
[here]( why I wrote this, I hate missing details!

# Example bad or empty links

<a href=""></a> Empty
<a href></a> Empty
<a href=""></a> Any bad link will fail, this one is missing http://

## Command line

> existence /path/to/dir
Checking links...
57 of 57
All of your links exist!

> existence /path/to/bad/links
Broken link found in file /path/to/bad/links/index.html on line 121 linking to None
Broken link found in file /path/to/bad/links/other.html on line 22 linking to non-existant.html

## Python

>>> from existence import scan
>>> scan("/path/to/dir")
>>> scan("/path/to/bad/links")
('None', '/path/to/bad/links/index.html', 121),
('non-existant.html', '/path/to/bad/links/other.html', 22)
# Returns a list of bad url tuples: [(url, file_name, line_number)]

# Progress bar

To enable the progress bar `pip install progressbar==2.3`

# Running tests

> python -m unittest discover

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for existence, version 0.2.6
Filename, size File type Python version Upload date Hashes
Filename, size (5.7 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page