{"slug": "your-vibe-coded-site-is-a-blank-page-to-crawlers-i-wrote-a-checker", "title": "Your Vibe-Coded Site Is a Blank Page to Crawlers. I Wrote a Checker.", "summary": "A developer built crawler_view.py, a standard-library script that parses raw HTML without executing JavaScript and flags AI-generated single-page sites whose content and JSON-LD schema only appear after hydration. Testing a fictional Denver roofing site built as a Vite + React app, the checker found the deployed HTML was just a scaffolding title and an empty #root div, and that a prerendered variant invented an aggregateRating of 4.9 from 214 reviews. The tool reports the title, visible word count, empty root containers, and whether schema facts like phone, address and rating also appear in visible text.", "body_md": "This week on X, someone described a plumbing company's AI-built site: real service pages, six blocks of structured data, and a blank page to any crawler that didn't run JavaScript. That is the same shape I keep seeing when a marketing site comes out of a coding agent as a Vite + React app and ships with the default `index.html`.\n\nThe title is still `Vite + React`. The body is `<div id=\"root\"></div>`. The services, the phone number, the reviews, and the JSON-LD all live in a `useEffect`. `curl` sees none of it. Chrome looks finished, so nobody notices until Search Console or an assistant-search result comes back empty.\n\nGooglebot can render JavaScript, but it does not always wait, and the first look at the response is still the raw HTML. A lot of AI crawlers are closer to `curl` than to a full browser. Social previews are too: Slack, LinkedIn and X read the HTML you sent, not the tree React built after hydration.\n\nIt doesn't matter whether the site came from Cursor, Claude Code or an [AI website builder](https://polydraft.ai/). If the HTML response is a shell, this applies.\n\nSo I wrote the kind of site a coding agent produces for \"a roofing company in Denver with services, reviews and a quote form.\" Then I wrote a short checker, `crawler_view.py`, that reads the raw HTML — no JavaScript — and reports the title, the visible word count, whether `#root` is empty, and whether any JSON-LD facts are missing from the visible text. I ran it on the shell, on a prerendered page that still invented 214 reviews, and on a prerendered page that only marks up what's on the page. All the numbers below come from those three runs.\n\nThe business is fictional. It's called Redbird Roofing, and it does residential roof repair in Denver. The \"before\" repo looks like a typical generated SPA: a Vite `index.html` and a React tree that injects both the page and the schema in the browser.\n\nHere is the file that actually gets deployed, before any prerender step. This is the whole document.\n\n```\n<!doctype html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"UTF-8\" />\n    <link rel=\"icon\" type=\"image/svg+xml\" href=\"https://dev.to/vite.svg\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n    <title>Vite + React</title>\n    <script type=\"module\" src=\"https://dev.to/src/main.jsx\"></script>\n  </head>\n  <body>\n    <div id=\"root\"></div>\n  </body>\n</html>\n```\n\nThe useful page lives in `App.jsx`. A `useEffect` appends the JSON-LD after mount. That includes an `aggregateRating` of 4.9 from 214 reviews, because the prompt asked for reviews and the model is happy to invent a number that looks like social proof.\n\n```\n// Excerpt from the fixture. Deliberately typical of a generated marketing SPA.\nuseEffect(() => {\n  const el = document.createElement(\"script\");\n  el.type = \"application/ld+json\";\n  el.text = JSON.stringify(schema); // includes aggregateRating 4.9 / 214\n  document.head.appendChild(el);\n}, []);\n```\n\nIf you open the site in a browser, you see a roofing company. If you view source, you see an empty root and a scaffolding title.\n\n`crawler_view.py` reads a local HTML file — or an `index.html` under `public/`, `dist/` or `build/` — and parses it with the standard library. It does not execute JavaScript, so the report is what `curl`, a basic crawler, or the first look at a response body can see.\n\nIt reports:\n\n`<title>` and meta description`<h1>` in the raw HTML`script` and `style` removed (a `<noscript>` block does count, because a no-JS client can read it)`#root`, `#app`, `#__next`, `#__nuxt` with almost no text inside`application/ld+json` block, its types, and whether telephone, address, price, `ratingValue` and `reviewCount` also appear in the visible text\nDefault titles it treats as scaffolding include `Vite + React`, `Create Next App`, `React App` and a few cousins. A US phone number in schema may be written as `+1-303-555-0148` while the page shows `(303) 555-0148`; the checker compares digits, not punctuation.\n\nIt does not render the page, does not claim to be Google's renderer, and does not fetch a live site. Point it at an HTML file you already have, including a response you saved with `curl -o page.html https://yoursite.example/`.\n\n``` bash\n#!/usr/bin/env python3\n\"\"\"crawler_view.py — show what of a page is visible without running JavaScript.\n\nUsage:\n  python3 crawler_view.py fixtures/before\n  python3 crawler_view.py path/to/index.html\n  python3 crawler_view.py --self-test\n\nReads the raw HTML (a local file, or a directory containing index.html,\npublic/index.html or dist/index.html). It does not execute JavaScript, so\nthe report is what a curl, a basic crawler, or Google's first look at the\nresponse body can see.\n\nFindings:\n  default title     — Vite + React, Create Next App, and similar scaffolding\n  crawler-blank     — almost no visible text, often an empty #root / #app\n  missing H1        — no <h1> in the raw HTML\n  no JSON-LD        — no application/ld+json block in the raw HTML\n  invented schema   — JSON-LD facts that do not appear in the visible text\n\nThis does not render the page, does not claim to be Google's renderer, and\ndoes not fetch a live site unless you pass a raw HTML file you already saved.\n\"\"\"\n\nfrom __future__ import annotations\n\nimport argparse\nimport json\nimport re\nimport sys\nimport unittest\nfrom dataclasses import dataclass, field\nfrom html.parser import HTMLParser\nfrom pathlib import Path\n\nDEFAULT_TITLES = {\n    \"vite + react\",\n    \"vite + vue\",\n    \"vite + svelte\",\n    \"vite app\",\n    \"vite\",\n    \"react app\",\n    \"create next app\",\n    \"create react app\",\n    \"next.js\",\n    \"document\",\n    \"nuxt\",\n    \"nuxt app\",\n    \"sveltekit\",\n    \"astro\",\n    \"welcome to vite\",\n    \"just a moment...\",\n    \"just a moment…\",\n}\n\nROOT_IDS = {\"root\", \"app\", \"__next\", \"__nuxt\"}\nSKIP_TAGS = {\"script\", \"style\", \"template\", \"noscript\"}\n# noscript is visible to a no-JS client, so it is NOT skipped for text.\nSKIP_TAGS = {\"script\", \"style\", \"template\"}\nWORD_RE = re.compile(r\"[A-Za-z0-9][A-Za-z0-9'’.-]*\")\nPHONE_RE = re.compile(r\"\\+?\\d[\\d\\-().\\s]{6,}\\d\")\nBLANK_THRESHOLD = 40\n\n# JSON-LD keys whose values should also be visible on the page.\nFACT_KEYS = {\n    \"telephone\": \"telephone\",\n    \"phone\": \"telephone\",\n    \"email\": \"email\",\n    \"streetaddress\": \"street address\",\n    \"addresslocality\": \"city\",\n    \"addressregion\": \"region\",\n    \"postalcode\": \"postal code\",\n    \"ratingvalue\": \"ratingValue\",\n    \"reviewcount\": \"reviewCount\",\n    \"ratingcount\": \"ratingCount\",\n    \"pricecurrency\": \"priceCurrency\",\n    \"price\": \"price\",\n    \"lowprice\": \"lowPrice\",\n    \"highprice\": \"highPrice\",\n}\n\n@dataclass\nclass SchemaFact:\n    key: str\n    label: str\n    value: str\n    visible: bool\n    kind: str  # \"text\" | \"phone\" | \"rating\" | \"count\" | \"price\"\n\n@dataclass\nclass Report:\n    path: Path\n    title: str = \"\"\n    meta_description: str = \"\"\n    h1s: list[str] = field(default_factory=list)\n    visible_text: str = \"\"\n    word_count: int = 0\n    empty_roots: list[str] = field(default_factory=list)\n    jsonld_blocks: list[object] = field(default_factory=list)\n    jsonld_types: list[str] = field(default_factory=list)\n    jsonld_errors: list[str] = field(default_factory=list)\n    facts: list[SchemaFact] = field(default_factory=list)\n    findings: list[str] = field(default_factory=list)\n\n    @property\n    def invented(self) -> list[SchemaFact]:\n        return [f for f in self.facts if not f.visible]\n\nclass PageParser(HTMLParser):\n    def __init__(self) -> None:\n        super().__init__(convert_charrefs=True)\n        self.title_parts: list[str] = []\n        self.meta_description = \"\"\n        self.h1s: list[str] = []\n        self._h1_buf: list[str] = []\n        self.visible: list[str] = []\n        self.ldjson: list[str] = []\n        self._ld_buf: list[str] = []\n        self.skip = 0\n        self.in_title = 0\n        self.in_h1 = 0\n        self.in_ld = 0\n        self.in_head = 0\n        self.root_text: dict[str, list[str]] = {}\n        self._root_stack: list[str] = []\n\n    def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None:\n        if tag == \"head\":\n            self.in_head += 1\n        ad = {k.lower(): (v or \"\") for k, v in attrs}\n        if tag == \"meta\":\n            name = ad.get(\"name\", \"\").lower()\n            prop = ad.get(\"property\", \"\").lower()\n            if name == \"description\" or prop == \"og:description\":\n                if ad.get(\"content\") and not self.meta_description:\n                    self.meta_description = ad[\"content\"].strip()\n        if tag == \"title\":\n            self.in_title += 1\n        if tag == \"h1\":\n            self.in_h1 += 1\n            self._h1_buf = []\n        if tag == \"script\":\n            typ = ad.get(\"type\", \"\").lower()\n            if typ in {\"application/ld+json\", \"application/json+ld\"}:\n                self.in_ld += 1\n                self._ld_buf = []\n            else:\n                self.skip += 1\n            return\n        if tag in SKIP_TAGS:\n            self.skip += 1\n            return\n        eid = ad.get(\"id\", \"\")\n        if eid in ROOT_IDS:\n            self._root_stack.append(eid)\n            self.root_text.setdefault(eid, [])\n\n    def handle_endtag(self, tag: str) -> None:\n        if tag == \"head\" and self.in_head:\n            self.in_head -= 1\n        if tag == \"title\" and self.in_title:\n            self.in_title -= 1\n        if tag == \"h1\" and self.in_h1:\n            self.in_h1 -= 1\n            text = _norm(\"\".join(self._h1_buf))\n            if text:\n                self.h1s.append(text)\n            self._h1_buf = []\n        if tag == \"script\" and self.in_ld:\n            self.in_ld -= 1\n            self.ldjson.append(\"\".join(self._ld_buf))\n            self._ld_buf = []\n            return\n        if tag in SKIP_TAGS or tag == \"script\":\n            if self.skip:\n                self.skip -= 1\n            return\n        if self._root_stack and tag in {\"div\", \"main\", \"app\"}:\n            # pop only when this end tag likely closes the root we opened.\n            # HTMLParser doesn't give us identity; we pop if the top root\n            # already received some end of a container. Safer: only pop on\n            # explicit close of div when stack is non-empty and skip==0.\n            pass\n\n    def handle_data(self, data: str) -> None:\n        if self.in_ld:\n            self._ld_buf.append(data)\n            return\n        if self.skip:\n            return\n        if self.in_title:\n            self.title_parts.append(data)\n        if self.in_h1:\n            self._h1_buf.append(data)\n        # Title, meta and other head text are not page body.\n        if self.in_head or self.in_title:\n            return\n        self.visible.append(data)\n        for rid in self._root_stack:\n            self.root_text[rid].append(data)\n\n    def handle_startendtag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None:\n        self.handle_starttag(tag, attrs)\n        self.handle_endtag(tag)\n\ndef _norm(s: str) -> str:\n    return re.sub(r\"\\s+\", \" \", s).strip()\n\ndef _words(s: str) -> list[str]:\n    return WORD_RE.findall(s)\n\ndef _digits(s: str) -> str:\n    return re.sub(r\"\\D+\", \"\", s)\n\ndef _national_phone(s: str) -> str:\n    \"\"\"Best-effort national number: strip a leading country code 1 from NANP numbers.\"\"\"\n    d = _digits(s)\n    if len(d) == 11 and d.startswith(\"1\"):\n        return d[1:]\n    return d\n\ndef resolve_html(target: str) -> Path:\n    p = Path(target)\n    if p.is_file():\n        return p\n    if not p.is_dir():\n        raise SystemExit(f\"not a file or directory: {p}\")\n    for cand in (\n        p / \"index.html\",\n        p / \"public\" / \"index.html\",\n        p / \"dist\" / \"index.html\",\n        p / \"out\" / \"index.html\",\n        p / \"build\" / \"index.html\",\n    ):\n        if cand.is_file():\n            return cand\n    raise SystemExit(f\"no index.html under {p}\")\n\ndef _collect_types(node: object, out: list[str]) -> None:\n    if isinstance(node, list):\n        for item in node:\n            _collect_types(item, out)\n        return\n    if not isinstance(node, dict):\n        return\n    typ = node.get(\"@type\")\n    if isinstance(typ, list):\n        out.extend(str(t) for t in typ)\n    elif typ:\n        out.append(str(typ))\n    graph = node.get(\"@graph\")\n    if graph:\n        _collect_types(graph, out)\n    for key, val in node.items():\n        if key in {\"@type\", \"@graph\"}:\n            continue\n        if isinstance(val, (dict, list)):\n            _collect_types(val, out)\n\ndef _walk_facts(node: object, out: list[tuple[str, str]]) -> None:\n    if isinstance(node, list):\n        for item in node:\n            _walk_facts(item, out)\n        return\n    if not isinstance(node, dict):\n        return\n    for key, val in node.items():\n        if key.startswith(\"@\"):\n            if key == \"@graph\":\n                _walk_facts(val, out)\n            continue\n        lk = key.lower()\n        if lk in FACT_KEYS and isinstance(val, (str, int, float)):\n            out.append((lk, str(val).strip()))\n        elif isinstance(val, (dict, list)):\n            _walk_facts(val, out)\n\ndef _fact_visible(key: str, value: str, visible: str, visible_digits: str) -> tuple[bool, str, str]:\n    label = FACT_KEYS[key]\n    if key in {\"telephone\", \"phone\"}:\n        digits = _digits(value)\n        national = _national_phone(value)\n        ok = len(national) >= 7 and (national in visible_digits or digits in visible_digits)\n        return ok, label, \"phone\"\n    if key in {\"ratingvalue\", \"reviewcount\", \"ratingcount\"}:\n        # The exact number must appear in the visible text.\n        compact = value.replace(\",\", \"\").strip()\n        ok = bool(re.search(rf\"(?<![\\d.]){re.escape(compact)}(?![\\d.])\", visible.replace(\",\", \"\")))\n        kind = \"rating\" if key == \"ratingvalue\" else \"count\"\n        return ok, label, kind\n    if key in {\"price\", \"lowprice\", \"highprice\"}:\n        compact = value.replace(\",\", \"\").strip()\n        ok = compact in visible.replace(\",\", \"\")\n        return ok, label, \"price\"\n    # Address / email / currency: case-insensitive substring.\n    ok = value.lower() in visible.lower()\n    return ok, label, \"text\"\n\ndef inspect(path: Path) -> Report:\n    raw = path.read_text(encoding=\"utf-8\", errors=\"replace\")\n    parser = PageParser()\n    parser.feed(raw)\n    parser.close()\n    title = _norm(\"\".join(parser.title_parts))\n    visible = _norm(\"\".join(parser.visible))\n    words = _words(visible)\n    report = Report(\n        path=path,\n        title=title,\n        meta_description=_norm(parser.meta_description),\n        h1s=parser.h1s,\n        visible_text=visible,\n        word_count=len(words),\n    )\n    for rid, parts in parser.root_text.items():\n        text = _norm(\"\".join(parts))\n        if len(_words(text)) <= 3:\n            report.empty_roots.append(rid)\n    visible_digits = _digits(visible)\n    for chunk in parser.ldjson:\n        text = chunk.strip()\n        if not text:\n            continue\n        try:\n            data = json.loads(text)\n        except json.JSONDecodeError as exc:\n            report.jsonld_errors.append(f\"invalid JSON-LD: {exc.msg}\")\n            continue\n        report.jsonld_blocks.append(data)\n        types: list[str] = []\n        _collect_types(data, types)\n        for t in types:\n            if t not in report.jsonld_types:\n                report.jsonld_types.append(t)\n        found: list[tuple[str, str]] = []\n        _walk_facts(data, found)\n        for key, value in found:\n            if not value:\n                continue\n            ok, label, kind = _fact_visible(key, value, visible, visible_digits)\n            report.facts.append(SchemaFact(key, label, value, ok, kind))\n    # Findings, in a stable order.\n    if title.lower() in DEFAULT_TITLES or not title:\n        report.findings.append(\"default title\")\n    # A JS shell is usually an empty #root with almost no body text.\n    # A short but complete page (title, H1, real copy) is not a shell.\n    is_shell = bool(report.empty_roots) and report.word_count < 80\n    is_tiny = report.word_count < 12 and not report.h1s\n    if is_shell or is_tiny:\n        report.findings.append(\"crawler-blank\")\n    if not report.h1s:\n        report.findings.append(\"missing H1\")\n    if not report.jsonld_blocks:\n        report.findings.append(\"no JSON-LD\")\n    if report.invented:\n        report.findings.append(\"invented schema\")\n    if report.jsonld_errors:\n        report.findings.append(\"invalid JSON-LD\")\n    return report\n\ndef format_report(report: Report) -> str:\n    lines: list[str] = []\n    lines.append(f\"crawler_view.py  (no JavaScript)\")\n    lines.append(f\"file: {report.path}\")\n    lines.append(\"\")\n    lines.append(\"PAGE\")\n    lines.append(f\"  title              {report.title or '(none)'}\")\n    lines.append(f\"  meta description   {report.meta_description or '(none)'}\")\n    if report.h1s:\n        for i, h in enumerate(report.h1s, 1):\n            label = \"H1\" if i == 1 else f\"H1 #{i}\"\n            lines.append(f\"  {label:<18} {h}\")\n    else:\n        lines.append(\"  H1                 (none)\")\n    lines.append(f\"  visible words      {report.word_count}\")\n    if report.empty_roots:\n        lines.append(\"  empty containers   #\" + \", #\".join(report.empty_roots))\n    else:\n        lines.append(\"  empty containers   (none)\")\n    lines.append(\"\")\n    lines.append(\"JSON-LD\")\n    if report.jsonld_errors:\n        for err in report.jsonld_errors:\n            lines.append(f\"  error              {err}\")\n    if not report.jsonld_blocks:\n        lines.append(\"  blocks             0\")\n        lines.append(\"  types              (none)\")\n    else:\n        lines.append(f\"  blocks             {len(report.jsonld_blocks)}\")\n        lines.append(\"  types              \" + \", \".join(report.jsonld_types) or \"(none)\")\n        if report.facts:\n            lines.append(\"  facts vs visible text:\")\n            for fact in report.facts:\n                mark = \"visible\" if fact.visible else \"NOT on the page\"\n                lines.append(f\"    {fact.label:<16} {fact.value:<20} {mark}\")\n        else:\n            lines.append(\"  facts              (none checked)\")\n    lines.append(\"\")\n    lines.append(\"FINDINGS\")\n    if report.findings:\n        for f in report.findings:\n            lines.append(f\"  - {f}\")\n    else:\n        lines.append(\"  (none)\")\n    lines.append(\"\")\n    lines.append(\"VERDICT\")\n    if \"crawler-blank\" in report.findings:\n        lines.append(\"  The raw HTML has almost no visible text.\")\n        if report.empty_roots:\n            ids = \", \".join(f\"#{i}\" for i in report.empty_roots)\n            lines.append(f\"  {ids} is empty without JavaScript, so a crawler that does not run JS sees a shell.\")\n        if \"default title\" in report.findings:\n            lines.append(f\"  The title is still {report.title!r}, which is scaffolding, not a page title.\")\n        if \"no JSON-LD\" in report.findings:\n            lines.append(\"  Any schema in the React tree never reaches the HTML response.\")\n    elif \"invented schema\" in report.findings:\n        n = len(report.invented)\n        lines.append(f\"  The page has visible content, but {n} JSON-LD fact(s) are not on the page.\")\n        names = \", \".join(f\"{f.label}={f.value}\" for f in report.invented)\n        lines.append(f\"  {names}.\")\n        lines.append(\"  Google's structured data guidelines say not to mark up content that is not visible.\")\n    elif report.findings == [\"no JSON-LD\"]:\n        lines.append(\"  The raw HTML has a real title, an H1 and enough visible text.\")\n        lines.append(\"  There is no JSON-LD in the response; add it only for facts already on the page.\")\n    elif report.findings:\n        lines.append(\"  \" + \"; \".join(report.findings) + \".\")\n    else:\n        lines.append(\"  The raw HTML has a real title, an H1 and enough visible text.\")\n        if report.facts:\n            lines.append(\"  JSON-LD facts checked here also appear in the visible text.\")\n    return \"\\n\".join(lines) + \"\\n\"\n\n# ---------------------------------------------------------------------------\n# Tests\n# ---------------------------------------------------------------------------\n\nSHELL = \"\"\"<!doctype html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"UTF-8\" />\n    <title>Vite + React</title>\n    <script type=\"module\" src=\"https://dev.to/src/main.jsx\"></script>\n  </head>\n  <body>\n    <div id=\"root\"></div>\n  </body>\n</html>\n\"\"\"\n\nINVENTED = \"\"\"<!doctype html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"UTF-8\" />\n    <title>Redbird Roofing | Denver roof repair</title>\n    <meta name=\"description\" content=\"Roof repair and replacement in Denver.\" />\n    <script type=\"application/ld+json\">\n    {\n      \"@context\": \"https://schema.org\",\n      \"@type\": \"RoofingContractor\",\n      \"name\": \"Redbird Roofing\",\n      \"telephone\": \"+1-303-555-0148\",\n      \"address\": {\n        \"@type\": \"PostalAddress\",\n        \"streetAddress\": \"14 Redbird Way\",\n        \"addressLocality\": \"Denver\",\n        \"addressRegion\": \"CO\",\n        \"postalCode\": \"80211\"\n      },\n      \"aggregateRating\": {\n        \"@type\": \"AggregateRating\",\n        \"ratingValue\": \"4.9\",\n        \"reviewCount\": \"214\",\n        \"bestRating\": \"5\"\n      }\n    }\n    </script>\n  </head>\n  <body>\n    <h1>Denver roof repair and replacement</h1>\n    <p>Redbird Roofing fixes leaks and replaces roofs for homes in Denver, Colorado.</p>\n    <p>Call (303) 555-0148. Visit us at 14 Redbird Way, Denver, CO 80211.</p>\n  </body>\n</html>\n\"\"\"\n\nHONEST = \"\"\"<!doctype html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"UTF-8\" />\n    <title>Redbird Roofing | Denver roof repair</title>\n    <meta name=\"description\" content=\"Roof repair and replacement in Denver.\" />\n    <script type=\"application/ld+json\">\n    {\n      \"@context\": \"https://schema.org\",\n      \"@type\": \"RoofingContractor\",\n      \"name\": \"Redbird Roofing\",\n      \"telephone\": \"+1-303-555-0148\",\n      \"address\": {\n        \"@type\": \"PostalAddress\",\n        \"streetAddress\": \"14 Redbird Way\",\n        \"addressLocality\": \"Denver\",\n        \"addressRegion\": \"CO\",\n        \"postalCode\": \"80211\"\n      }\n    }\n    </script>\n  </head>\n  <body>\n    <h1>Denver roof repair and replacement</h1>\n    <p>Redbird Roofing fixes leaks and replaces roofs for homes in Denver, Colorado.</p>\n    <p>Call (303) 555-0148. Visit us at 14 Redbird Way, Denver, CO 80211.</p>\n  </body>\n</html>\n\"\"\"\n\nclass CrawlerViewTests(unittest.TestCase):\n    def setUp(self) -> None:\n        self.tmp = Path(\"/tmp/crawler_view_tests\")\n        self.tmp.mkdir(exist_ok=True)\n\n    def _write(self, name: str, html: str) -> Path:\n        path = self.tmp / name\n        path.write_text(html, encoding=\"utf-8\")\n        return path\n\n    def test_shell_is_crawler_blank_with_default_title(self) -> None:\n        r = inspect(self._write(\"shell.html\", SHELL))\n        self.assertEqual(r.title, \"Vite + React\")\n        self.assertEqual(r.word_count, 0)\n        self.assertIn(\"root\", r.empty_roots)\n        self.assertIn(\"default title\", r.findings)\n        self.assertIn(\"crawler-blank\", r.findings)\n        self.assertIn(\"missing H1\", r.findings)\n        self.assertIn(\"no JSON-LD\", r.findings)\n        self.assertNotIn(\"invented schema\", r.findings)\n\n    def test_invented_rating_is_flagged_when_page_has_no_reviews(self) -> None:\n        r = inspect(self._write(\"invented.html\", INVENTED))\n        self.assertGreater(r.word_count, 20)\n        self.assertNotIn(\"crawler-blank\", r.findings)\n        self.assertIn(\"RoofingContractor\", r.jsonld_types)\n        self.assertIn(\"invented schema\", r.findings)\n        missing = {(f.key, f.value) for f in r.invented}\n        self.assertIn((\"ratingvalue\", \"4.9\"), missing)\n        self.assertIn((\"reviewcount\", \"214\"), missing)\n        # Phone and address are on the page, so they must not be invented.\n        self.assertFalse(any(f.key == \"telephone\" and not f.visible for f in r.facts))\n        self.assertFalse(any(f.key == \"streetaddress\" and not f.visible for f in r.facts))\n\n    def test_honest_schema_has_no_findings(self) -> None:\n        r = inspect(self._write(\"honest.html\", HONEST))\n        self.assertEqual(r.findings, [])\n        self.assertTrue(all(f.visible for f in r.facts))\n        self.assertIn(\"Denver roof repair and replacement\", r.h1s)\n\n    def test_phone_matches_on_digits_not_formatting(self) -> None:\n        r = inspect(self._write(\"honest.html\", HONEST))\n        phone = next(f for f in r.facts if f.key == \"telephone\")\n        self.assertTrue(phone.visible)\n\n    def test_rating_must_appear_as_the_same_number(self) -> None:\n        html = HONEST.replace(\n            \"</h1>\",\n            \"</h1><p>Customers rate us 4.8 out of 5 from 12 reviews.</p>\",\n        ).replace(\n            '\"postalCode\": \"80211\"',\n            '\"postalCode\": \"80211\",\\n      \"aggregateRating\": {\"@type\":\"AggregateRating\",\"ratingValue\":\"4.9\",\"reviewCount\":\"214\"}',\n        )\n        r = inspect(self._write(\"almost.html\", html))\n        missing = {f.key: f.value for f in r.invented}\n        self.assertEqual(missing.get(\"ratingvalue\"), \"4.9\")\n        self.assertEqual(missing.get(\"reviewcount\"), \"214\")\n\n    def test_visible_rating_is_accepted(self) -> None:\n        html = HONEST.replace(\n            \"</h1>\",\n            \"</h1><p>Rated 4.9 from 214 reviews.</p>\",\n        ).replace(\n            '\"postalCode\": \"80211\"',\n            '\"postalCode\": \"80211\",\\n      \"aggregateRating\": {\"@type\":\"AggregateRating\",\"ratingValue\":\"4.9\",\"reviewCount\":\"214\"}',\n        )\n        r = inspect(self._write(\"matched.html\", html))\n        self.assertNotIn(\"invented schema\", r.findings)\n\n    def test_client_only_jsonld_in_module_script_is_invisible(self) -> None:\n        html = SHELL.replace(\n            '<script type=\"module\" src=\"https://dev.to/src/main.jsx\"></script>',\n            '''<script type=\"module\">\n            document.getElementById(\"root\").innerHTML = \"<h1>Hi</h1>\";\n            const s = document.createElement(\"script\");\n            s.type = \"application/ld+json\";\n            s.textContent = JSON.stringify({@context:\"https://schema.org\",@type:\"LocalBusiness\",name:\"X\"});\n            document.head.appendChild(s);\n            </script>'''.replace(\"{@\", \"{'@\").replace(\"@type\", \"'@type\"),  # keep as JS, not parsed as ld+json\n        )\n        # The block above is a module script, not application/ld+json, so raw HTML has none.\n        r = inspect(self._write(\"client.html\", html))\n        self.assertEqual(r.jsonld_blocks, [])\n        self.assertIn(\"no JSON-LD\", r.findings)\n        self.assertIn(\"crawler-blank\", r.findings)\n\n    def test_noscript_counts_as_visible(self) -> None:\n        html = \"\"\"<!doctype html><html><head><title>Shop</title></head>\n        <body><div id=\"root\"></div>\n        <noscript><h1>Redbird Roofing</h1><p>%s</p></noscript>\n        </body></html>\"\"\" % (\" \".join([\"roof\"] * 50))\n        r = inspect(self._write(\"noscript.html\", html))\n        self.assertGreaterEqual(r.word_count, 50)\n        self.assertIn(\"Redbird Roofing\", r.h1s)\n        self.assertNotIn(\"crawler-blank\", r.findings)\n\n    def test_invalid_jsonld_is_reported(self) -> None:\n        html = HONEST.replace('\"Redbird Roofing\"', '\"Redbird Roofing\",')  # trailing comma after name via... \n        # Safer: inject a broken block.\n        html = HONEST.replace(\n            \"</script>\",\n            '</script>\\n<script type=\"application/ld+json\">{not json}</script>',\n        )\n        r = inspect(self._write(\"badjson.html\", html))\n        self.assertIn(\"invalid JSON-LD\", r.findings)\n        self.assertTrue(r.jsonld_errors)\n\n    def test_resolve_prefers_public_index(self) -> None:\n        root = self.tmp / \"proj\"\n        (root / \"public\").mkdir(parents=True, exist_ok=True)\n        (root / \"public\" / \"index.html\").write_text(SHELL, encoding=\"utf-8\")\n        self.assertEqual(resolve_html(str(root)), root / \"public\" / \"index.html\")\n\n    def test_loading_spinner_inside_root_still_blank(self) -> None:\n        html = SHELL.replace('<div id=\"root\"></div>', '<div id=\"root\">Loading...</div>')\n        r = inspect(self._write(\"loading.html\", html))\n        self.assertLess(r.word_count, BLANK_THRESHOLD)\n        self.assertIn(\"crawler-blank\", r.findings)\n        self.assertIn(\"root\", r.empty_roots)\n\n    def test_format_report_mentions_empty_root(self) -> None:\n        r = inspect(self._write(\"shell.html\", SHELL))\n        text = format_report(r)\n        self.assertIn(\"visible words      0\", text)\n        self.assertIn(\"#root\", text)\n        self.assertIn(\"Vite + React\", text)\n        self.assertIn(\"almost no visible text\", text)\n        self.assertIn(\"#root\", text)\n\ndef main(argv: list[str] | None = None) -> int:\n    p = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)\n    p.add_argument(\"target\", nargs=\"?\", help=\"HTML file or directory containing index.html\")\n    p.add_argument(\"--self-test\", action=\"store_true\", help=\"run the unit tests and exit\")\n    args = p.parse_args(argv)\n    if args.self_test or args.target is None and \"--self-test\" in (argv or sys.argv[1:]):\n        suite = unittest.defaultTestLoader.loadTestsFromTestCase(CrawlerViewTests)\n        result = unittest.TextTestRunner(verbosity=2).run(suite)\n        return 0 if result.wasSuccessful() else 1\n    if not args.target:\n        p.print_help()\n        return 2\n    path = resolve_html(args.target)\n    sys.stdout.write(format_report(inspect(path)))\n    return 0\n\nif __name__ == \"__main__\":\n    raise SystemExit(main())\nbash\n$ python3 crawler_view.py fixtures/before\n\ncrawler_view.py  (no JavaScript)\nfile: fixtures/before/index.html\n\nPAGE\n  title              Vite + React\n  meta description   (none)\n  H1                 (none)\n  visible words      0\n  empty containers   #root\n\nJSON-LD\n  blocks             0\n  types              (none)\n\nFINDINGS\n  - default title\n  - crawler-blank\n  - missing H1\n  - no JSON-LD\n\nVERDICT\n  The raw HTML has almost no visible text.\n  #root is empty without JavaScript, so a crawler that does not run JS sees a shell.\n  The title is still 'Vite + React', which is scaffolding, not a page title.\n  Any schema in the React tree never reaches the HTML response.\n```\n\nZero words. No H1. No JSON-LD. The six-block schema in `App.jsx` might as well not exist for anything that doesn't run the bundle.\n\nThis is easy to miss because the failure is invisible in the tool you use all day. The tab looks right. The Lighthouse run you did in Chrome looks right. The thing that isn't right is the bytes you actually shipped.\n\nThe first \"fix\" a coding agent reaches for is to keep the SPA and inject JSON-LD in `useEffect`. That does not change Run 1. The schema still arrives after JavaScript runs, so `curl` still sees an empty `#root`.\n\nThe fix that actually changes the report is to put the page in the HTML: a prerender, server rendering, or a site generator. I did that for Redbird Roofing. The title, the H1, the services, the phone number and the address are now in the document. I also left in the `aggregateRating` the agent wanted to add — 4.9 from 214 reviews — even though the page has no reviews on it.\n\n``` bash\n$ python3 crawler_view.py fixtures/mid\n\nPAGE\n  title              Redbird Roofing | Denver roof repair and replacement\n  meta description   Roof repair, reroofing, and leak inspections for homes in Denver, Colorado. Call Redbird Roofing at (303) 555-0148.\n  H1                 Denver roof repair and replacement\n  visible words      102\n  empty containers   (none)\n\nJSON-LD\n  blocks             1\n  types              RoofingContractor, PostalAddress, AggregateRating\n  facts vs visible text:\n    telephone        +1-303-555-0148      visible\n    street address   14 Redbird Way       visible\n    city             Denver               visible\n    region           CO                   visible\n    postal code      80211                visible\n    ratingValue      4.9                  NOT on the page\n    reviewCount      214                  NOT on the page\n\nFINDINGS\n  - invented schema\n\nVERDICT\n  The page has visible content, but 2 JSON-LD fact(s) are not on the page.\n  ratingValue=4.9, reviewCount=214.\n  Google's structured data guidelines say not to mark up content that is not visible.\n```\n\n102 visible words, a real title, a real H1, and a LocalBusiness-style block whose phone and address match the page. That is progress. It is also a new problem. The rating is only in the markup.\n\nGoogle's structured data guidelines are blunt about this: don't mark up content that is not visible to readers of the page. Review-star markup for reviews that are not on the page is the version that can get you into spam policy trouble, not just a missing rich result. If you have two named testimonials, put those two on the page and mark those two up. If you don't have 214 reviews to show, don't tell the crawler you do.\n\nWe treat \"does the markup match the visible page?\" as its own check in our [GEO audit checklist](https://polydraft.ai/blog/geo-audit-checklist), next to a rendering check that fetches the page with JavaScript off and asks whether the headings survive. The two failures here are the same failure in different clothes: the crawler is being told a story the HTML does not tell.\n\nThe second rewrite dropped `aggregateRating` and left the `RoofingContractor` facts that already appear in the contact section. No other copy changed, so the visible word count stayed at 102.\n\n``` bash\n$ python3 crawler_view.py fixtures/after\n\nPAGE\n  title              Redbird Roofing | Denver roof repair and replacement\n  H1                 Denver roof repair and replacement\n  visible words      102\n  empty containers   (none)\n\nJSON-LD\n  blocks             1\n  types              RoofingContractor, PostalAddress\n  facts vs visible text:\n    telephone        +1-303-555-0148      visible\n    street address   14 Redbird Way       visible\n    city             Denver               visible\n    region           CO                   visible\n    postal code      80211                visible\n\nFINDINGS\n  (none)\n\nVERDICT\n  The raw HTML has a real title, an H1 and enough visible text.\n  JSON-LD facts checked here also appear in the visible text.\n```\n\nThat's the bar. Not \"has schema.\" \"The raw HTML is a page, and the schema is a machine-readable copy of that page.\"\n\nOnce the checker has barked at you, the work is three decisions, not one \"add SEO\" prompt.\n\n`useEffect` is not.`curl` and no JavaScript can't quote your phone number, neither can a lot of the machines you care about.\nNone of this replaces a full render in Google's tools. It does catch the failure I actually see on vibe-coded marketing sites, and it catches it before you point a domain at the preview. It sits next to the rest of a [launch-day SEO checklist](https://polydraft.ai/blog/seo-for-new-website-launch-plan): one list checks that search engines can find the right URLs, this one checks that the URL they fetch is a page.\n\nPolyDraft is the [AI website builder](https://polydraft.ai/) we work on. It publishes server-rendered HTML to your own Cloudflare account, so the document a crawler fetches is the document you can view-source, not a shell waiting on a bundle. That makes a check like this easy to run. It does not make it unnecessary. An agent can still prerender a page and then invent 214 reviews in the JSON-LD. We still run checks like these on what we ship, and you should run them on anything with your name on the domain, whoever or whatever built it.\n\n`Vite + React` and an empty `aggregateRating` until the reviews are visible.`crawler_view.py` again after the next prompt. A scan you run once is a scan that is out of date after the agent \"adds SEO.\"\nTen minutes, all of it against HTML you already have, all of it on your own site. Cheaper than finding out from a Search Console coverage report, or from a customer who pasted your URL into ChatGPT and got an answer about a different company.", "url": "https://wpnews.pro/news/your-vibe-coded-site-is-a-blank-page-to-crawlers-i-wrote-a-checker", "canonical_source": "https://dev.to/polydraft/your-vibe-coded-site-is-a-blank-page-to-crawlers-i-wrote-a-checker-1pfn", "published_at": "2026-11-25 03:25:03+00:00", "updated_at": "2026-11-25 03:42:35.079570+00:00", "lang": "en", "topics": ["ai-crawlers", "generative-engine-optimization", "structured-data", "ai-tools", "developer-tools"], "entities": ["Redbird Roofing", "Vite", "React", "Googlebot", "Cursor", "Claude Code", "polydraft.ai", "Slack"], "also_reported_by": [], "takeaway": "Client-rendered SPAs ship an empty #root and scaffolding title to non-JS crawlers, so check raw HTML for visible text and schema facts before assuming a page is indexable.", "recommendation": {"advice": "Prerender or server-render marketing pages so title, body text and JSON-LD appear in the raw HTML, and run a no-JS checker to confirm schema facts like phone and rating are visible.", "playbook": "agent-architecture", "playbook_url": "https://wpnews.pro/playbooks/agent-architecture"}, "alternates": {"html": "https://wpnews.pro/news/your-vibe-coded-site-is-a-blank-page-to-crawlers-i-wrote-a-checker", "markdown": "https://wpnews.pro/news/your-vibe-coded-site-is-a-blank-page-to-crawlers-i-wrote-a-checker.md", "text": "https://wpnews.pro/news/your-vibe-coded-site-is-a-blank-page-to-crawlers-i-wrote-a-checker.txt", "jsonld": "https://wpnews.pro/news/your-vibe-coded-site-is-a-blank-page-to-crawlers-i-wrote-a-checker.jsonld"}}