A static page arrives from the server as finished HTML, and a dynamic page is turned into HTML by scripts in the browser. For a scraper that label is only half the question, because what decides the fetch is whether the plain HTTP response already holds every record and field you need, in markup or as data.
So two questions sit side by side. Where the HTML is made is a fact about the site. Which fetch you send is a choice you make per kind of page, and the cheapest fetch that yields complete records is the one to keep. Making that call early is part of planning any web scraping job.
Where the line falls
Web developers sort pages by where the HTML gets made, and web.dev's guide by Addy Osmani and Jason Miller gives the terms. Server-side rendering is "Rendering an app on the server to send HTML, rather than JavaScript, to the client." Client-side rendering is "Rendering an app in a browser, using JavaScript to modify the DOM." The same guide also covers prerendering, "Running a client-side application at build time to capture its initial state as static HTML." So a site written in a heavy framework can still hand you finished HTML.
Google's guide to JavaScript in search puts the line at the first response too. Crawling and parsing what comes back, it says, "works well for classical websites or server-side rendered pages where the HTML in the HTTP response contains all content." The guide goes on to recommend server-side rendering or prerendering, since "not all bots can run JavaScript."
Neither label tells you where your data is. A server can build its HTML fresh on every request and still leave out the part you need. A page that a script draws in the browser can still ship every record in the first response, as data the script reads. The useful test is narrower than either label: run the plain fetch, then try to extract complete records from it.
This clip counts one address both ways, with a selector and by reading the script.
Read the transcript
Static or rendered: check the plain HTML. One address fetched plain and in a browser, counted both ways.
A selector finds 0 quote blocks in the plain body. The status is still 200. The plain HTTP body: status 200, 5808 bytes. div.quote matches 0 elements in it, 0 of the 10 blocks the browser body holds. 0: elements match div.quote. 200: status, so nothing looks wrong.
The same body holds all 10 records in a script, as data. The same plain HTTP body, status 200, 5808 bytes, holds 10 records in a script. 10: records in a script. 10: with every field filled. 10: distinct, no two alike.
The browser body draws 10 blocks from those same 10 records. The plain HTTP body: status 200, 5808 bytes, 0 div.quote, 10 script records. The browser body: status 200, 9057 bytes, 10 div.quote, 10 script records. 3249 bytes: more in the browser body. 10: records in each body. 200: status of both.
Extract from the plain body both ways before you pay for a render. Which fetch to keep: the plain body holds. markup: Selectors find it. Keep http. script: Parse the script. Keep http. neither: Find the request, or render. This run: script.
Read the full page. The page is at spider.cloud/learn/static-vs-rendered.
The run: one page, two raw bodies
Quotes to Scrape is a site built for scraping practice, and its /js/ page shows ten quotes when you open it in a browser. The script below sends that page to /scrape twice, first with request set to http and then with it set to chrome, both with return_format set to raw so the body comes back as HTML.
It checks each body two ways. First it counts the div elements with the class quote, the blocks a CSS selector such as div.quote would match. Then it looks for a script that assigns var data = [...], parses that array as JSON, and counts the records, the ones with a text, an author name and tags all filled in, and the distinct ones by text and author. It prints those counts with the status and the body size, and nothing from the quotes themselves. It reads your key from SPIDER_API_KEY:
"""Fetch one page twice through the Spider API, once as plain HTTP and once in a
browser, and count the quotes each raw body holds.
python3 count_quotes.py
For each fetch it prints the status, the size of the body in bytes, how many
<div class="quote"> elements the body holds, and how many records a script in the
body holds as data with a text, an author name and tags filled in.
"""
import json
import os
import sys
import urllib.request
from html.parser import HTMLParser
API = "https://api.spider.cloud/scrape"
URL = "https://quotes.toscrape.com/js/"
USER_AGENT = "examplebot/1.0 (+https://example.com/bot; bot@example.com)"
MARKER = "var data = "
class QuoteCounter(HTMLParser):
def __init__(self):
super().__init__()
self.quotes = 0
def handle_starttag(self, tag, attrs):
classes = (dict(attrs).get("class") or "").split()
if tag == "div" and "quote" in classes:
self.quotes += 1
def script_records(html):
"""The records in the page's `var data = [...]` script, or None if there is none."""
start = html.find(MARKER)
if start == -1:
return None
try:
records, _ = json.JSONDecoder().raw_decode(html, start + len(MARKER))
except ValueError:
return None
return records if isinstance(records, list) else None
def complete(record):
return bool(record.get("text") and (record.get("author") or {}).get("name") and record.get("tags"))
def fetch(key, mode):
body = json.dumps({"url": URL, "request": mode, "return_format": "raw",
"user_agent": USER_AGENT}).encode()
req = urllib.request.Request(API, data=body, headers={
"Authorization": f"Bearer {key}",
"Content-Type": "application/json",
})
with urllib.request.urlopen(req, timeout=120) as resp:
page = json.load(resp)
return page[0] if isinstance(page, list) else page
def main() -> int:
key = os.environ.get("SPIDER_API_KEY")
if not key:
print("set SPIDER_API_KEY first")
return 1
for mode in ("http", "chrome"):
page = fetch(key, mode)
html = page.get("content") or ""
counter = QuoteCounter()
counter.feed(html)
records = script_records(html)
data = "no script data" if records is None else (
f"{len(records)} script records, {sum(map(complete, records))} complete, "
f"{len({(r.get('text'), (r.get('author') or {}).get('name')) for r in records})} distinct")
size = len(html.encode("utf-8"))
print(f"{mode:<6} status {page.get('status')}, {size} bytes, {counter.quotes} div.quote, {data}")
return 0
if __name__ == "__main__":
sys.exit(main())The run was on 2026-11-21 at 21:23 UTC. This is everything it printed:
http status 200, 5808 bytes, 0 div.quote, 10 script records, 10 complete, 10 distinct
chrome status 200, 9057 bytes, 10 div.quote, 10 script records, 10 complete, 10 distinctWhat the two bodies say
The plain body was 5,808 bytes and held no quote blocks. A scraper that aimed div.quote at it would have found nothing and concluded it needed a browser. The same body also held a script with ten records, every one with its text, author and tags, and no two alike. Ten quotes on screen, ten complete records in the plain response.
The browser body was 9,057 bytes and held ten quote blocks, one per quote on screen, drawn from that same array. Both came back 200, so the status gave no hint that one of them had nothing a div.quote selector could find.
By web.dev's terms this page is client-side rendered, since a script in the browser builds the markup a reader sees. For a scraper it behaves like a static page anyway, because the server sends every record in the first response. One plain fetch, parsed as JSON instead of as markup, yields every field. The API reference lists chrome as an older name for browser, so send browser in your own code.
How to tell before you choose
Settle this once for each kind of page on a site, such as a listing, a detail page and a search result, before you write the scraper.
- List the fields you need, and open a few pages in your own browser. Note how many records each shows and something that identifies each one, such as a title, a product code or a link.
- Fetch the same pages as plain HTTP with
return_formatset toraw. - Extract from that body with selectors. Then check what you got against step 1: the same number of records, each one you noted present, no duplicates, and every required field filled. Keep
httponly if all of that holds. - If the selectors miss records or fields, search the body for a script that holds the records as data, an array or a JSON object. Parse it and run the same checks on it. A count that looks right can still hide a duplicate standing in for a missing record, so check identities, not just totals.
- If neither the markup nor any script holds complete records, the missing ones most likely come from a later request. Look for it in your browser's network panel, the way the infinite scroll lesson does for lists that load as you scroll. Render the page only when you can't find that request or can't repeat it.
Run these checks on more than one page of each kind. A listing that holds complete records on page one can drop a field on a page where some items lack it.
A render costs the site more than a plain fetch does. A browser also loads the scripts, styles and images the page asks for, so the site serves more for every page you read. A site's robots.txt and its terms bind a rendered fetch the same way they bind a plain one, and a browser doesn't change what they allow.
Do this, avoid this
Do this
- Write your extraction against the plain raw body first, and keep http when it yields complete records.
- Look for the records inside a script before you switch to a browser, and parse them as JSON if they are there.
- Check the records you extracted against the page: the count, the identity of each one, and every required field.
- Note which fetch each kind of page on a site needs, so only those pages are rendered.
Avoid this
- Choosing the fetch from the status code. Both bodies in this run came back 200.
- Switching to a browser because a CSS selector matched nothing in the plain body.
- Keeping the plain fetch because a count matched, without checking for duplicates and empty fields.
- Rendering every page of a site because one kind of page needed it.
Reading the run
Both counts came from the same 5,808 bytes. Before you pay for a render, extract from the plain body both ways and check what you get against the page.