How to Clone a Website's HTML, CSS, and JavaScript (Step-by-Step Guide)
Learn how to clone a website's HTML, CSS, and JavaScript with DevTools, wget, or headless capture, fix broken assets, and skip the grunt work with Shaw.
Updated November 21, 2026. Technical workflows below cover public client-side inspection and rendering tools, alongside Shaw's pre-built clone library.
Whether you are prototyping a landing page, learning how a fast layout works, or rebuilding a storefront architecture for your own brand, there are three reliable ways to capture a page's HTML, CSS, and JavaScript locally. Below are the exact step-by-step instructions for doing it by hand, what usually breaks afterward, and the much faster path when you just want a working page live.
Copyright and brand boundary: Inspecting public HTML, CSS layout rules, and DOM hierarchy is standard frontend engineering. Never republish another company's trademarks, logos, proprietary copy, or product photography as your own. Always swap every brand token, headline, image, and legal page for original assets before publishing.
Method 1: Save a static snapshot from Chrome DevTools
For simple marketing pages and static sites that ship server-rendered HTML, your browser already downloads everything required to render the page:
- Open the target URL in an incognito window so logged-in extensions or cached cookies do not pollute the DOM.
- Press `Cmd+Option+I` (macOS) or `Ctrl+Shift+I` (Windows/Linux) to open DevTools, then open the Network tab, check Disable cache, and reload the page so every CSS file, SVG, and font request records cleanly.
- Save the complete webpage: Press
Cmd+SorCtrl+Sand choose Webpage, Complete. Chrome writes an.htmlfile and an accompanying_files/folder containing stylesheets and scripts fetched on initial paint. - Capture computed styles for isolated components: If you only want one section (such as a hero or pricing table), right-click that element in the Elements panel, choose Copy > Copy outerHTML, and pull its matching CSS rules from the Styles pane.
Method 2: Mirror a multi-page static site with wget
When a traditional static website spans several inner routes (about, pricing, blog, or docs), manual saving misses sibling links. GNU wget walks internal links recursively from a shell:
wget \
--mirror \
--convert-links \
--adjust-extension \
--page-requisites \
--no-parent \
--restrict-file-names=windows \
https://example.com/
Each flag serves a specific purpose:
--mirror: Enables recursive fetching with infinite depth and timestamp checking.--page-requisites: Downloads stylesheets, external scripts, and image assets needed to display each HTML file cleanly offline.--convert-links: Rewrites internal hyperlinks and asset paths so local files point to the downloaded copies instead of live remote URLs.--adjust-extension: Appends.htmlto extensionless routes so local file servers open them with the right MIME type.--no-parent: Prevents the crawler from walking upward outside the target path.
Method 3: Capture JS-rendered React, Next.js, or Vue sites
Modern SPAs and Next.js / Remix storefronts often ship a thin HTML document and inject content after hydration. Running wget or curl on those URLs gives you an empty <div id="root"></div> shell. To save the post-hydration DOM instead:
- Browser extension capture: Install a single-file DOM serializer (such as SingleFile) that inlines computed styles, SVGs, and active DOM nodes after client JavaScript finishes running.
- Headless browser script (Playwright): Render the page at desktop (
1440x900) and mobile (390x844) viewports, wait for network idle, and serialize the live HTML:
import { chromium } from "playwright"
import { writeFileSync } from "node:fs"
const browser = await chromium.launch()
const page = await browser.newPage({ viewport: { width: 1440, height: 900 } })
await page.goto("https://example.com/", { waitUntil: "networkidle" })
writeFileSync("captured.html", await page.content(), "utf8")
await browser.close()
- Run a local preview server: Open the output folder with
npx serve .orpython3 -m http.server 8000rather than openingfile://, because root-relative paths (/styles.css,/hero.webp) resolve only over HTTP.
Method 4: Clean up what almost always breaks manually
Raw captures rarely behave cleanly out of the box. Before editing layout or copy, you usually have to fix five issues by hand:
- Hydration loops and router crashes: React/Next.js
<script>bundles often expect live API endpoints or matching checksums and overwrite your edits with a blank error boundary when run statically. Stripping framework runtime scripts frequently kills mobile menus, drawers, and tabs unless you rewrite those interactions in vanilla JS. - CORS-blocked webfonts:
@font-facedeclarations pointing back to the original CDN often reject cross-origin requests onlocalhostor a custom domain, causing typography to collapse to system Arial or Times New Roman. - Root-relative asset 404s: Background images inside CSS
url('/assets/...'),srcsetresponsive image candidates, and lazy-loadeddata-srcattributes stay broken if only the visible desktop pass was captured. - Tracker bloat and third-party pixels: Live pages carry analytics beacons, cookie banners, tag managers, and A/B test scripts that fail or phone home with errors until stripped manually.
- Re-theming from zero: Replacing dozens of hardcoded hex values, spacing tokens, brand copy, and mobile breakpoints takes hours of search-and-replace across minified stylesheets.
Why it is much easier to just use Shaw
If your end goal is a clean, working site tailored to your own brand rather than debugging broken wget mirrors and dead hydration bundles, it is much easier to just use Shaw.
- Start from 1,000+ working HTML/CSS/JS clones instead of capturing them yourself: Shaw indexes 777 brands and 3,732 live surfaces (841 websites, 92 apps, and 2,798 full-height lifecycle emails totaling 18,882 captured pages) across 19 design categories. Every clone on Websites, Apps, and Emails already has localized
.woff2fonts, cleaned assets, multi-page navigation trees, and working interactive desktop and mobile viewports. - Swap in your own brand system automatically: Run your existing domain through Shaw's free Brand DNA Extractor (or import directly from Shopify) to populate your Brand Kit, then open Remix (12 AI remixes per day on Free, 120 per day on Shaw Pro) to rewrite copy, re-map colors and typography, and generate fresh visual direction in one pass.
- Publish straight to edge hosting without server plumbing: Instead of wrestling with DNS, SSL, or broken asset paths, deploy straight to
*.shaw.site, connect a custom domain, publish landing pages to Shopify, or push HTML templates into Klaviyo. Raw template archive downloads stay edge-locked on Shaw (/api/templates/zip/*returns403) because the whole pipeline runs from inspection through live hosting in one place.
Want to build from a layout structure instead of scraping source files? Continue to How to Copy a Website Design and Layout, compare manual vs hosted workflows in Shaw vs Webflow, or browse Websites.
Sources
Explore Shaw
Browse 1,000+ working HTML/CSS/JS clones across 750+ brands and 21 categories, compare alternatives, or read the docs: