Extraction

JavaScript Rendering

Many modern websites load content after the initial page request using JavaScript.

When this happens, a standard extraction may return incomplete content because the page has not finished rendering.

To handle these websites, enable JavaScript rendering with the render_js option.

When to Use JavaScript Rendering

Enable JavaScript rendering when:

  • Important content is missing from the extraction result
  • Content appears after the page loads
  • The website relies on client-side rendering

Enable JavaScript Rendering

Set render_js to true in your extraction request.

request.sh
curl -X POST "https://scraper.geonode.io/v1/extract" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://geonode.com/",
    "render_js": true
  }'

Request Breakdown

FieldDescription
urlThe webpage to extract content from.
render_jsRenders the page in a browser before extracting content.

Response

A successful response includes the rendered page content and extraction metadata.

response.json
{
  "data": {
    "html": "<html>...</html>"
  },
  "metadata": {
    "url": "https://geonode.com/",
    "render_js": true,
    "http_status": 200
  }
}

Notice that metadata.render_js is set to true, confirming that browser rendering was used during extraction.

Things to Consider

JavaScript rendering provides more complete extraction results for dynamic websites, but it may:

  • Take longer than a standard extraction
  • Use additional browser resources
  • Be unnecessary for static websites

For static websites, leave render_js disabled for faster extraction.

Success

You can now extract content from websites that rely on JavaScript to display their content.

Next Steps

Continue to Processing Modes to learn the difference between synchronous and asynchronous extraction requests.

On this page