René's URL Explorer Experiment


Title: Get JavaScript-rendered HTML in Node.js — working code

Open Graph Title: Get JavaScript-rendered HTML in Node.js — working code

X Title: Get JavaScript-rendered HTML in Node.js — working code

Description: Fetch the HTML of a JavaScript page after it rendered, in Node.js: sync, async with a webhook, and error handling. Tested code.

Open Graph Description: Fetch the HTML of a JavaScript page after it rendered, in Node.js: sync, async with a webhook, and error handling. Tested code.

X Description: Fetch the HTML of a JavaScript page after it rendered, in Node.js: sync, async with a webhook, and error handling. Tested code.

Mail addresses
contact@urlpipe.dev

Opengraph URL: https://urlpipe.dev/code/node/rendered-html

direct link

Domain: urlpipe.dev


Hey, it has json ld scripts:
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://urlpipe.dev/#organization","name":"URLpipe","url":"https://urlpipe.dev","logo":"https://urlpipe.dev/icon.png","sameAs":["https://github.com/URLpipe"],"founder":{"@type":"Person","name":"Roger Campos","url":"https://rogercampos.com"}},{"@type":"WebSite","@id":"https://urlpipe.dev/#website","url":"https://urlpipe.dev","name":"URLpipe","publisher":{"@id":"https://urlpipe.dev/#organization"}}]}
{"@context":"https://schema.org","@graph":[{"@type":"TechArticle","@id":"https://urlpipe.dev/code/node/rendered-html#article","headline":"Get JavaScript-rendered HTML in Node.js — working code","description":"Fetch the HTML of a JavaScript page after it rendered, in Node.js: sync, async with a webhook, and error handling. Tested code.","url":"https://urlpipe.dev/code/node/rendered-html","mainEntityOfPage":"https://urlpipe.dev/code/node/rendered-html","datePublished":"2026-09-24","dateModified":"2026-09-24","author":{"@type":"Person","name":"Roger Campos","url":"https://rogercampos.com"},"publisher":{"@id":"https://urlpipe.dev/#organization"},"image":"https://urlpipe.dev/og-image.png"},{"@type":"FAQPage","mainEntity":[{"@type":"Question","name":"How is this different from fetching the URL myself?","acceptedAnswer":{"@type":"Answer","text":"A plain GET returns what the server sent before any JavaScript ran. /html returns the DOM after the page's scripts ran in real Chrome — the HTML a visitor's browser actually holds."}},{"@type":"Question","name":"Can I wait for content that loads late?","acceptedAnswer":{"@type":"Answer","text":"Yes: page_options.wait_for_selector waits up to 10 seconds for an element to appear, and delay adds a fixed wait. If the element never appears the request is a 422 and costs nothing."}},{"@type":"Question","name":"Does URLpipe follow robots.txt?","acceptedAnswer":{"@type":"Answer","text":"Yes, by default, for every project. You can turn it off per project, and then you are responsible for having the right to fetch those pages."}},{"@type":"Question","name":"Do I need an SDK to call URLpipe from Node.js?","acceptedAnswer":{"@type":"Answer","text":"No package is needed: Node 18 and later ship fetch, and the API is one POST per job. If you'd rather use one, the official client installs with npm install @urlpipe/sdk and adds retries that never bill twice, typed errors and webhook verification."}}]},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://urlpipe.dev/"},{"@type":"ListItem","position":2,"name":"Code recipes","item":"https://urlpipe.dev/code"},{"@type":"ListItem","position":3,"name":"Node.js","item":"https://urlpipe.dev/code/node"},{"@type":"ListItem","position":4,"name":"Get the rendered HTML of a JavaScript page in Node.js","item":"https://urlpipe.dev/code/node/rendered-html"}]},{"@type":"HowTo","name":"Get the rendered HTML of a JavaScript page in Node.js","description":"To get the HTML of a JavaScript-rendered page in Node.js, POST its URL to https://urlpipe.dev/html with sync set to true. The body is the DOM after the page's scripts ran in real Chrome, serialized as HTML — what a visitor's browser holds, not what the server first sent — read with await res.text(), for 1 credit.","url":"https://urlpipe.dev/code/node/rendered-html","tool":[{"@type":"HowToTool","name":"Node.js 18+"}],"step":[{"@type":"HowToStep","name":"Before you start","text":"Nothing to install: fetch is global from Node 18. The files end in .mjs so Node reads them as ES modules and top-level await works without a wrapper function.","url":"https://urlpipe.dev/code/node/rendered-html#setup"},{"@type":"HowToStep","name":"Save the rendered HTML and report its size","text":"sync: true keeps the request open until the result is ready. fetch resolves on any status, 4xx and 5xx included, so check res.ok yourself. Buffer.byteLength counts bytes; html.length would count UTF-16 code units and come out smaller on any page with non-ASCII text.","url":"https://urlpipe.dev/code/node/rendered-html#sync"},{"@type":"HowToStep","name":"The async variant: a token, a webhook and a poll","text":"Leave out sync and the answer is a token, straight away. setTimeout from node:timers/promises is the awaitable sleep, so the polling loop reads top to bottom.","url":"https://urlpipe.dev/code/node/rendered-html#async"},{"@type":"HowToStep","name":"Handle errors and retries","text":"Read the status before the body: a 401 answers in plain text, so res.json() would throw. .catch(() => ({})) turns any body that is not JSON into an empty object, and the status still says what happened.","url":"https://urlpipe.dev/code/node/rendered-html#errors"}]}]}

view-transitionsame-origin
csrf-paramauthenticity_token
csrf-tokentR-gsyeTh2GLTnn31v70ok9uVZT7RKNha-IWPNHyC-MW_GHi3nAFYNxKOQja4hTzlxTHbi6_Qw6udaxyfu4bOA
csp-nonce37d54f69c463ce966cd286176cd11e7e
og:typewebsite
og:site_nameURLpipe
og:localeen_US
og:imagehttps://urlpipe.dev/og-image.png
og:image:width1200
og:image:height630
og:image:altURLpipe — URL in. Clean data out.
twitter:cardsummary_large_image
twitter:imagehttps://urlpipe.dev/og-image.png
twitter:image:altURLpipe — URL in. Clean data out.
theme-color#3b82f6

Links:

Skip to main contenthttps://urlpipe.dev/code/node/rendered-html#main
URLpipehttps://urlpipe.dev/
Web scraping APIhttps://urlpipe.dev/web-scraping-api
URL to Markdown APIhttps://urlpipe.dev/url-to-markdown-api
MCP serverhttps://urlpipe.dev/mcp-server
Screenshot APIhttps://urlpipe.dev/screenshot-api
Lighthouse APIhttps://urlpipe.dev/lighthouse-api
Metadata APIhttps://urlpipe.dev/metadata-api
Console APIhttps://urlpipe.dev/console-api
Rendered HTML APIhttps://urlpipe.dev/rendered-html-api
URL to PDF APIhttps://urlpipe.dev/url-to-pdf-api
Website technology lookup APIhttps://urlpipe.dev/website-technology-lookup-api
Structured data extraction APIhttps://urlpipe.dev/structured-data-extraction-api
Keyword extraction APIhttps://urlpipe.dev/keyword-extraction-api
URL summarization APIhttps://urlpipe.dev/url-summarization-api
Web access for AI agentshttps://urlpipe.dev/use-cases/ai-agents
Web pages into a RAG pipelinehttps://urlpipe.dev/use-cases/rag-ingestion
Link previews and unfurlshttps://urlpipe.dev/use-cases/link-previews
Monitoring client websiteshttps://urlpipe.dev/use-cases/client-site-monitoring
Monitoring pages for changeshttps://urlpipe.dev/use-cases/content-monitoring
Archiving pages as screenshotshttps://urlpipe.dev/use-cases/visual-archiving
URL features inside a multi-tenant apphttps://urlpipe.dev/use-cases/multi-tenant-apps
Free toolshttps://urlpipe.dev/tools
Docshttps://urlpipe.dev/docs
Pricinghttps://urlpipe.dev/pricing
Guideshttps://urlpipe.dev/guides
Code recipeshttps://urlpipe.dev/code
Glossaryhttps://urlpipe.dev/glossary
Researchhttps://urlpipe.dev/research
Comparehttps://urlpipe.dev/compare
Changeloghttps://urlpipe.dev/changelog
Engineering noteshttps://urlpipe.dev/notes
Sign inhttps://urlpipe.dev/auth/session/new
Start freehttps://urlpipe.dev/auth/sign-up/new
Web scraping APIhttps://urlpipe.dev/web-scraping-api
URL to Markdown APIhttps://urlpipe.dev/url-to-markdown-api
MCP serverhttps://urlpipe.dev/mcp-server
Screenshot APIhttps://urlpipe.dev/screenshot-api
Lighthouse APIhttps://urlpipe.dev/lighthouse-api
Metadata APIhttps://urlpipe.dev/metadata-api
Console APIhttps://urlpipe.dev/console-api
Rendered HTML APIhttps://urlpipe.dev/rendered-html-api
URL to PDF APIhttps://urlpipe.dev/url-to-pdf-api
Website technology lookup APIhttps://urlpipe.dev/website-technology-lookup-api
Structured data extraction APIhttps://urlpipe.dev/structured-data-extraction-api
Keyword extraction APIhttps://urlpipe.dev/keyword-extraction-api
URL summarization APIhttps://urlpipe.dev/url-summarization-api
Web access for AI agentshttps://urlpipe.dev/use-cases/ai-agents
Web pages into a RAG pipelinehttps://urlpipe.dev/use-cases/rag-ingestion
Link previews and unfurlshttps://urlpipe.dev/use-cases/link-previews
Monitoring client websiteshttps://urlpipe.dev/use-cases/client-site-monitoring
Monitoring pages for changeshttps://urlpipe.dev/use-cases/content-monitoring
Archiving pages as screenshotshttps://urlpipe.dev/use-cases/visual-archiving
URL features inside a multi-tenant apphttps://urlpipe.dev/use-cases/multi-tenant-apps
Free toolshttps://urlpipe.dev/tools
Docshttps://urlpipe.dev/docs
Pricinghttps://urlpipe.dev/pricing
Guideshttps://urlpipe.dev/guides
Code recipeshttps://urlpipe.dev/code
Glossaryhttps://urlpipe.dev/glossary
Researchhttps://urlpipe.dev/research
Comparehttps://urlpipe.dev/compare
Changeloghttps://urlpipe.dev/changelog
Engineering noteshttps://urlpipe.dev/notes
Start freehttps://urlpipe.dev/auth/sign-up/new
Sign inhttps://urlpipe.dev/auth/session/new
Roger Camposhttps://rogercampos.com
Start freehttps://urlpipe.dev/auth/sign-up/new
See the APIhttps://urlpipe.dev/#endpoints
/htmlhttps://urlpipe.dev/docs/html
rendered vs raw HTML guidehttps://urlpipe.dev/guides/rendered-vs-raw-html
Markdownhttps://urlpipe.dev/code/node/html-to-markdown
Get the rendered HTML of any URLPaste a link and get the page's HTML after JavaScript has run and redirects have been followed — the DOM a real browser sees, not the empty shell curl returns.Try it freehttps://urlpipe.dev/tools/rendered-html
/html API docshttps://urlpipe.dev/docs/html
Client libraries in the docshttps://urlpipe.dev/docs/client-libraries
JavaScript client on GitHubhttps://github.com/URLpipe/urlpipe-js
Pythonhttps://urlpipe.dev/code/python/rendered-html
PHPhttps://urlpipe.dev/code/php/rendered-html
Rubyhttps://urlpipe.dev/code/ruby/rendered-html
Gohttps://urlpipe.dev/code/go/rendered-html
Javahttps://urlpipe.dev/code/java/rendered-html
C#https://urlpipe.dev/code/csharp/rendered-html
cURLhttps://urlpipe.dev/code/curl/rendered-html
every Node.js recipehttps://urlpipe.dev/code/node
robots.txthttps://urlpipe.dev/glossary/robots-txt
Get the rendered HTML of a JavaScript page in PHPhttps://urlpipe.dev/code/php/rendered-html
Polite scraping: robots.txt and pacinghttps://urlpipe.dev/guides/polite-scraping-robots-txt-and-rate-limits
DOMContentLoadedhttps://urlpipe.dev/glossary/domcontentloaded
Every result names the page it came from, after redirectshttps://urlpipe.dev/changelog/final-url
What stops a headless browser in 2026https://urlpipe.dev/research/what-stops-a-headless-browser
All of code recipeshttps://urlpipe.dev/code
Start freehttps://urlpipe.dev/auth/sign-up/new
URLpipehttps://urlpipe.dev/
Web scraping APIhttps://urlpipe.dev/web-scraping-api
URL to Markdown APIhttps://urlpipe.dev/url-to-markdown-api
MCP serverhttps://urlpipe.dev/mcp-server
Screenshot APIhttps://urlpipe.dev/screenshot-api
Lighthouse APIhttps://urlpipe.dev/lighthouse-api
Metadata APIhttps://urlpipe.dev/metadata-api
Console APIhttps://urlpipe.dev/console-api
Rendered HTML APIhttps://urlpipe.dev/rendered-html-api
URL to PDF APIhttps://urlpipe.dev/url-to-pdf-api
Website technology lookup APIhttps://urlpipe.dev/website-technology-lookup-api
Structured data extraction APIhttps://urlpipe.dev/structured-data-extraction-api
Keyword extraction APIhttps://urlpipe.dev/keyword-extraction-api
URL summarization APIhttps://urlpipe.dev/url-summarization-api
Free toolshttps://urlpipe.dev/tools
Pricinghttps://urlpipe.dev/pricing
Docshttps://urlpipe.dev/docs
Client librarieshttps://urlpipe.dev/docs/client-libraries
Guideshttps://urlpipe.dev/guides
Code recipeshttps://urlpipe.dev/code
Use caseshttps://urlpipe.dev/use-cases
Integrationshttps://urlpipe.dev/integrations
Glossaryhttps://urlpipe.dev/glossary
Researchhttps://urlpipe.dev/research
Engineering noteshttps://urlpipe.dev/notes
Changeloghttps://urlpipe.dev/changelog
llms.txthttps://urlpipe.dev/llms.txt
All comparisonshttps://urlpipe.dev/compare
URLpipe vs Firecrawlhttps://urlpipe.dev/compare/urlpipe-vs-firecrawl
URLpipe vs Jina Readerhttps://urlpipe.dev/compare/urlpipe-vs-jina-reader
Best HTML-to-Markdown APIshttps://urlpipe.dev/best-html-to-markdown-apis
Jina Reader alternativeshttps://urlpipe.dev/alternatives/jina-reader
Microlink alternativeshttps://urlpipe.dev/alternatives/microlink
ScreenshotOne alternativeshttps://urlpipe.dev/alternatives/screenshotone
Abouthttps://urlpipe.dev/about
Securityhttps://urlpipe.dev/security
Statushttps://urlpipe.dev/status
GitHubhttps://github.com/URLpipe
Privacyhttps://urlpipe.dev/privacy
Termshttps://urlpipe.dev/terms
Sign inhttps://urlpipe.dev/auth/session/new
Legal noticehttps://urlpipe.dev/terms#legal-notice
Roger Camposhttps://rogercampos.com

Viewport: width=device-width,initial-scale=1


URLs of crawlers that visited me.