Python Script Audits Internal Link Anchor Text Across a Sitemap, Outputs CSV Reports
A DEV Community article describes a standard-library Python tool that audits the anchor text of internal links across a site's sitemap. The script fetches every listed page and extracts each link's accessible name from visible text, image alt, aria-label, or title. It flags empty, generic, URL-as-text, overlong, and javascript: links, noting the page region where each sits. Results are exported as two CSV files: one row per link and one row per target page summarizing its inbound anchors. The author frames the approach around guidance from Google, Lighthouse, and W3C on descriptive link text.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in