June 8, 2026
Data Scraping
By
Tendem Team
Scraping Dynamic JavaScript Websites: Techniques & Solutions
You send an HTTP request to a product page. The response comes back – but the price field is empty, the reviews are missing, and the product details are nowhere in the HTML. Your scraper is not broken. The page is built with JavaScript. The data you see in your browser was loaded after the initial HTML arrived, rendered by client-side code that a simple HTTP request never executes.
This is the #1 scraping challenge in 2026. The majority of modern websites – including virtually all e-commerce platforms, single-page applications (SPAs), and content-heavy sites – rely on JavaScript to load content dynamically. React, Vue, Angular, and Next.js applications render their content client-side, meaning the raw HTML contains little or no usable data. Traditional HTTP-based scrapers that parse HTML without executing JavaScript get empty results, incomplete data, or placeholder text that was never meant to be seen by users.
This article explains why JavaScript breaks traditional scraping, the five techniques for extracting data from dynamic websites, how to choose the right approach for your target, and when to stop fighting with rendering and let a service handle the complexity.
Why JavaScript Breaks Traditional Scraping
Traditional web scraping works by sending an HTTP GET request to a URL and parsing the HTML that comes back. This approach was designed for server-rendered websites where the HTML contains all the content – text, prices, images, links – ready to be extracted. Modern JavaScript-heavy websites work differently. The server sends a minimal HTML shell (often just a div with an id like “root” or “app”) plus JavaScript bundles. The browser downloads these bundles, executes them, makes additional API calls to fetch data, and then renders the content into the DOM. This means the useful data never exists in the initial HTML response – it only appears after JavaScript execution and often after secondary network requests to backend APIs.
Website Type | How Data Loads | Simple HTTP Scraping Works? |
|---|---|---|
Static HTML (WordPress, basic sites) | All content in initial HTML response | Yes – all data present in HTML |
Server-side rendered (SSR) | Content pre-rendered on server, sent as HTML | Usually yes – most data in initial HTML |
Client-side rendered (React, Vue, Angular SPAs) | JavaScript builds the page after load; data fetched via AJAX/API calls | No – HTML contains empty containers |
Hybrid (Next.js, Nuxt) | Some content server-rendered, some loaded client-side | Partially – some data present, some missing |
Infinite scroll / lazy load | Content loads as user scrolls; pagination via JavaScript | No – only first batch visible in HTML |
Five Techniques for Scraping Dynamic Websites
Technique 1: Headless Browsers (Playwright, Puppeteer)
The most common solution: run a real browser without a visible window, let it execute JavaScript, wait for the page to fully render, then extract data from the rendered DOM. Playwright (supports Chromium, Firefox, and WebKit) and Puppeteer (Chromium-only) are the standard tools.
How it works: the headless browser loads the page exactly as a normal browser would – executing JavaScript, making API calls, rendering content, and populating the DOM. Once the page is fully loaded, you extract data from the rendered HTML using the same selectors you would use on a static page. Advantages include working on virtually any website regardless of rendering technology and supporting interaction (clicking, scrolling, form filling). Limitations include being significantly slower than HTTP requests (seconds per page vs milliseconds), consuming 10–50x more memory and CPU, and being detectable by advanced anti-bot systems that fingerprint headless browser environments.
Technique 2: Intercept API Calls Directly
Many JavaScript-heavy websites fetch their data from internal APIs. The page makes XHR or Fetch requests to backend endpoints, which return structured JSON – the same data that eventually renders on the page, but in a clean, structured format without any HTML to parse.
How it works: open your browser’s Developer Tools, navigate to the Network tab, load the target page, and look for XHR/Fetch requests that return JSON data. If you find the API endpoint, you can often call it directly with a simple HTTP request – no browser rendering needed. Advantages include being fastest method (direct API calls, no rendering), returning clean JSON that needs minimal parsing, and being most reliable because you are accessing the data source rather than the presentation layer. Limitations include that endpoints may require authentication tokens that expire, not all sites expose useful API endpoints, and the API structure may change without notice.
This is the technique that experienced scrapers try first. When it works, it eliminates the rendering overhead entirely.
Technique 3: Wait-for-Element Strategies
When using headless browsers, timing matters. A page may take 2–10 seconds to fully render, and extracting data before the target elements load produces empty results. Wait-for-element strategies tell the scraper to pause until specific elements appear in the DOM.
Common wait strategies include waiting for a specific CSS selector to appear (e.g., wait until div.product-price exists), waiting for network idle (no new requests for 500ms – suggesting the page is done loading), waiting for a specific text pattern (e.g., wait until a dollar sign appears on the page), and setting a fixed timeout as a fallback (wait 5 seconds maximum, then extract whatever is available). The risk is timeouts that are too short (data not yet loaded) or too long (wasting resources). Adaptive strategies that combine element detection with reasonable fallback timeouts produce the most reliable results.
Technique 4: AI-Powered Semantic Extraction
AI scraping tools like ScrapeGraphAI, Crawl4AI, and Browse AI use language models to interpret page content semantically rather than relying on specific HTML selectors. You describe what you want (“extract the product name and price”), and the AI identifies the correct elements regardless of how they are rendered.
This approach handles JavaScript-heavy sites because the AI works with the rendered page content (what the user sees) rather than the raw HTML (what the server sends). When combined with headless browser rendering, AI extraction eliminates most selector maintenance – the AI adapts to layout changes automatically. The limitation is cost (AI processing per page is more expensive than traditional parsing) and occasional accuracy issues (the AI may extract the wrong field when multiple similar-looking elements exist).
Technique 5: Use a Scraping API with Built-In Rendering
Scraping APIs like ScrapingBee, ScrapFly, and Zenrows offer JavaScript rendering as a built-in feature. You send the target URL with a parameter like “render_js=true” and the API handles headless browser execution, waits for the page to load, and returns the fully rendered HTML or structured data. This eliminates the need to manage your own headless browser infrastructure – the API provider handles the browsers, memory, and scaling.
Choosing the Right Technique
Situation | Best Technique | Why |
|---|---|---|
Data available via hidden API endpoints | Intercept API calls | Fastest, cleanest, most reliable |
Simple JS rendering on a few pages | Headless browser (Playwright) | Direct control, works on any site |
Large-scale extraction from JS-heavy sites | Scraping API with rendering | Infrastructure handled by provider; scales easily |
Sites that change structure frequently | AI-powered extraction | Adapts to layout changes without selector maintenance |
Complex pages with infinite scroll | Headless browser + scroll automation | Simulates user interaction to load all content |
High-value, quality-critical data | Managed service | Handles rendering + validation; zero maintenance |
Common Pitfalls and How to Avoid Them
Extracting before the page finishes loading is the most common mistake. Always implement explicit wait conditions rather than fixed delays. Ignoring API endpoints wastes resources – before building a headless browser solution, spend 10 minutes in the Network tab checking for direct API calls. Running headless browsers at scale without resource management leads to memory leaks, crashes, and unreliable results – use browser pooling, page recycling, and concurrent session limits. Not handling anti-bot on top of rendering means that even with JavaScript execution, your headless browser may still get blocked if it has detectable fingerprints. And failing to validate output after rendering – a page that renders partially due to a network error produces data that looks complete but is missing fields.
Where Human Validation Matters
JavaScript-rendered content introduces unique quality risks. Pages may render differently based on geographic location, device type, or authentication status. Lazy-loaded content may not fully render even with scroll automation. A/B tests may present different versions of the same page to different visitors. And content loaded from third-party widgets (review apps, chat widgets, recommendation engines) may not load at all in headless browser environments.
Human reviewers validate that scraped data matches what a real user actually sees on the page – catching the rendering inconsistencies, partial loads, and A/B test variations that automated extraction cannot detect reliably.
Stop fighting with JavaScript rendering – describe your data needs to Tendem’s AI agent, and we handle the rendering, extraction, and validation.
Conclusion
JavaScript-rendered websites are the norm in 2026, not the exception. The five techniques – headless browsers, API interception, wait-for-element strategies, AI extraction, and scraping APIs with rendering – provide solutions at every complexity level. The best approach depends on your target sites, scale, and quality requirements.
For most teams, the practical advice is to check for hidden API endpoints first (the fastest and most reliable approach), use a scraping API with built-in rendering for moderate-scale operations, and move to a managed service when the combination of JavaScript rendering, anti-bot bypass, and data validation becomes more infrastructure than your team should manage.
Get data from any website – static or dynamic – Tendem’s AI agent handles JavaScript rendering, anti-bot challenges, and quality validation in one pipeline.
Related Resources
Learn about anti-bot challenges in our how anti-bot systems work guide.
Compare scraping APIs in our web scraping APIs explained article.
Understand proxy infrastructure in our proxy rotation guide.
Start without code in our data scraping for beginners guide.
Explore Tendem’s data scraping services.

