
Crawl a website’s internal pages to extract SEO, accessibility, performance and link-structure data, then visualize the results as a D3 network graph with page scorecards and analysis from Claude.
The Python crawler in app.py begins with a chosen website, visits up to a user-defined number of internal pages and extracts details about accessibility, performance, security, links and more. It then saves the generated site map and audit data to links.json before launching a Flask server for interactive analysis.
On the frontend, main.js loads links.json and renders the crawled website as a D3 network graph, with pages represented as nodes and internal links shown as connections. The Flask backend in flask_server.py provides an API for analyzing selected pages, while anthropic_api.py sends each page’s structured crawl data to Claude for a review of SEO, accessibility and suggested improvements.
Below are the required software programs and instructions for using this application on a Linux machine.
Install the above programs
Open a terminal
Clone this repository: git clone git@github.com:devbret/mapping-website-internal-links.git
Navigate to the repo's directory: cd mapping-website-internal-links
Create a virtual environment: python3 -m venv venv
Activate your virtual environment: source venv/bin/activate
Install the needed dependencies: pip install -r requirements.txt
Change the local .env.template file into a .env file: cp .env.template .env
Set the environment variable for your Anthropic API key in the new .env file
In the new .env file, set the WEBSITE_TO_CRAWL variable to your chosen website
In the new .env file, set the MAX_PAGES_TO_CRAWL variable to the maximum number of pages to crawl
Run the primary script: python3 app.py
Open a second terminal
Navigate to the repo's directory again: cd mapping-website-internal-links
Launch a local HTTP server: python3 -m http.server
Open the local app in your browser: http://localhost:8000
When finished exploring, stop the local HTTP server: CTRL + C
Also stop the Flask server: CTRL + C
Exit the virtual environment: deactivate
This project repo is intended to demonstrate an ability to do the following:
Crawl a website’s internal pages and turn the structure into a JSON dataset
Extract SEO, accessibility, performance, security and other measurements from each page crawled
Visualize the website as a D3 network graph, making internal links easier to explore
Enable users to request analysis by Claude for improvement suggestions
If working with GitHub codespaces, you may have to:
python -m nltk.downloader punkt_tabIf all else fails, please contact the maintainer here on GitHub or via LinkedIn.
Cheers!
$ claude mcp add mapping-website-internal-links \
-- python -m otcore.mcp_server <graph>