linkchecker
un outil très pratique pour tester les liens de son site, en ligne de commandes, nombreux exports possibles Check websites for broken links
LinkChecker is a free, GPL licensed URL validator.
Exemple
rendu html
linkchecker https://radeff.red/blog --output=html > ~/checklinks.html
rendu csv
linkchecker https://radeff.red/blog --output=csv > ~/checklinks.csv
autres options
-o TYPE[/ENCODING], --output=TYPE[/ENCODING] Specify output type as text, html, sql, csv, gml, dot, xml, sitemap, none or blacklist. Default type is text. The various output types are documented below. The ENCODING specifies the output encoding, the default is that of your locale. Valid encodings are listed at http://docs.python.org/library/codecs.html#standard-encodings. use --check-extern to check extern URLs.
ATTENTION! récursion
Par défaut, linkchecker lance une récursion infinie… Si votre site est gros, cela peut vite devenir une sacrée usine à gaz et méchamment charger votre serveur:
-rNUMBER, --recursion-level=NUMBER Check recursively all links up to given depth. A negative depth will enable infinite recursion. Default depth is infinite.
Pour limiter à un seul namespace (liens internes)
solution 1
on va ici vérifier uniquement les liens de type www.monsite.ch/monrepertoire
linkchecker \ --check-extern \ --ignore-url="^https://www\.monsite\.ch/(?!monrepertoire/)" \ --ignore-url="^https://www\.monsite\.ch/monrepertoire/#" \ --no-status \ --verbose \ https://www.monsite.ch/monrepertoire/
solution 2
utiliser l'option -r1 :
linkchecker -r1 https://radeff.red/recettes/restaurants --output=html > ~/checklinks.html