# Compare raw and rendered HTML

Find what JavaScript adds, removes, or changes between the server response and the rendered page.

## What you need

- A representative public URL for each affected template and the content or links you expect to see.
- An HTTP client and a JavaScript-capable browser or crawler. Include the Search Console property when Google-specific evidence is needed.

## Steps

### 1. Capture the original response

Fetch the exact URL. Save the request time, status, redirect path, response headers, and original HTML. Record the final URL and any X-Robots-Tag header before opening the page in a browser.

### 2. Capture the page after rendering

Open the final URL in a clean browser session with JavaScript enabled. Save the DOM and record the viewport, wait condition, and any failed requests. Record which content appears without interaction. If clicking or scrolling exposes more content, capture it separately.

### 3. Diff the search-critical fields

Compare the title, meta robots, canonical, main heading, visible content, and internal links with href attributes. Classify each difference as added, removed, or changed. Attach the smallest HTML or DOM snippet that shows what changed.

### 4. Check Google’s view where available

Use Search Console URL Inspection to run a live test and inspect the tested page’s HTML or screenshot when available. Label live and indexed observations separately and record the inspection date. Give priority to a server noindex on a page intended for search or a canonical that changes to an unrelated URL.

### 5. Define a check for the fix

Assign the issue to the affected template or component. Write the expected raw and rendered value, then rerun the sampled URLs after the change. Add a neighboring template to catch regressions beyond the original example.

## Sample evidence diff

A sample service template serves a placeholder title and inserts a related-service link after JavaScript runs.

| Field | Raw response | Rendered DOM | Next check |
| --- | --- | --- | --- |
| Title | Services | Boiler repair in Leeds | Serve the page-specific title in the initial response. |
| Canonical | /services/boiler-repair | /services/ | Trace the script that replaces the canonical. |
| Related-service link | Absent | Anchor linking to /services/maintenance | Check whether it appears in Google’s live render. |

## Prompt for your agent

Compare the raw response and rendered DOM for [URLs]. Use the same final URL for each comparison. Record the response status, headers, rendering conditions, and any failed requests. Return a table of title, robots directives, canonical, main content, and crawlable links with raw value, rendered value, evidence excerpt, and proposed change. If Search Console access is available, attach the live test result as separate evidence. Finish with a retest for each proposed fix.

## Tools for this job

- [Screaming Frog](https://seotoolsforagents.com/mcp-servers/screaming-frog.md) — Use SEO Spider crawl outputs to investigate site structure and page-level issues.
- [Sitebulb](https://seotoolsforagents.com/mcp-servers/sitebulb.md) — Review audit issues and compare crawls when tracking a technical fix.
- [Google Search Console](https://seotoolsforagents.com/mcp-servers/google-search-console.md) — Investigate Google Search clicks, impressions, queries, and inspection data for properties you can access.

## Sources

- [Google’s JavaScript SEO guide](https://developers.google.com/search/docs/crawling-indexing/javascript/javascript-seo-basics)
- [Search Console URL Inspection](https://support.google.com/webmasters/answer/9012289)
- [Screaming Frog JavaScript crawl guide](https://www.screamingfrog.co.uk/seo-spider/tutorials/crawl-javascript-seo/)

## Where to go next

- [Find why pages aren’t indexed](https://seotoolsforagents.com/playbooks/indexing-triage.md)
