How to Scrape JavaScript-Rendered Websites: React, Vue & Angular in 2026

Modern websites use JavaScript frameworks like React, Vue, and Angular. Traditional scraping fails on these sites. Learn proven techniques to extract data from any JavaScript-rendered page.

How to Scrape JavaScript-Rendered Websites: React, Vue & Angular in 2026

The JavaScript Problem

In 2026, over 80% of websites use JavaScript to render content. This presents a significant challenge for web scrapers.

What Happens When You Scrape a JS Site

When you make a traditional HTTP request to a JavaScript-rendered website:

python
import requests

response = requests.get('https://react-website.com')
print(response.text)

You get this:

html
<!DOCTYPE html>
<html>
<head><title>Loading...</title></head>
<body>
  <div id="root"></div>  <!-- Empty! -->
  <script src="/bundle.js"></script>
</body>
</html>

Instead of this:

html
<div id="root">
  <div class="product-list">
    <div class="product">iPhone 15 - $999</div>
    <div class="product">Samsung S24 - $899</div>
    <!-- Actual content -->
  </div>
</div>

The content is generated by JavaScript after the page loads in a browser. Traditional HTTP requests don't execute JavaScript.


Identifying JS-Rendered Sites

Quick Detection Methods

Method 1: View Page Source

  1. Right-click → "View Page Source"
  2. If you see empty <div id="root"> or <div id="app"> → JavaScript-rendered

Method 2: Disable JavaScript

  1. Open DevTools → Settings → Disable JavaScript
  2. Reload the page
  3. If content disappears → JavaScript-rendered

Method 3: Check for Framework Indicators

javascript
// React
document.querySelector('[data-reactroot]')

// Vue
document.querySelector('[data-v-]')

// Angular
document.querySelector('[ng-version]')

Common JS-Rendered Platforms

Platform TypeExamplesFramework
E-commerceShopify, BigCommerceReact/Vue
Social MediaTwitter, InstagramReact
SaaS DashboardsMost B2B appsReact/Angular
News SitesMany modern publishersVarious

Solution Approaches

Approach Comparison

MethodSpeedReliabilityComplexityCost
LucidExtractor APIFastHighVery LowPer-credit
Headless Browser (Self-hosted)SlowMediumHighInfrastructure
API InterceptionVery FastVariableMediumLow
Server-Side Rendering DetectionFastLowMediumLow

Decision Framework

text
Is it a JS-rendered site?
├── Yes
│   ├── Can you find the underlying API?
│   │   ├── Yes → Use API Interception (fastest)
│   │   └── No → Use JS Rendering
│   │       ├── Production/Scale → LucidExtractor API
│   │       └── Learning/Simple → Self-hosted Playwright
└── No → Traditional HTTP scraping

Using Headless Browsers

What is a Headless Browser?

A headless browser is a web browser without a graphical user interface. It executes JavaScript just like Chrome or Firefox, but runs programmatically.

  • Playwright (Microsoft) - Best for modern web apps
  • Puppeteer (Google) - Chrome-focused
  • Selenium - Legacy, widely supported

Playwright Example

python
from playwright.sync_api import sync_playwright

def scrape_react_site(url):
    with sync_playwright() as p:
        # Launch browser
        browser = p.chromium.launch(headless=True)
        page = browser.new_page()
        
        # Navigate and wait for content
        page.goto(url)
        page.wait_for_selector('.product-list')
        
        # Extract data
        products = page.query_selector_all('.product-card')
        data = []
        
        for product in products:
            data.append({
                'name': product.query_selector('.name').inner_text(),
                'price': product.query_selector('.price').inner_text(),
            })
        
        browser.close()
        return data

# Usage
products = scrape_react_site('https://react-store.com')

Problems with Self-Hosted Browsers

  1. Infrastructure Overhead - Need servers with Chrome installed
  2. Memory Usage - Each browser instance uses 200-500MB RAM
  3. Detection - Headless browsers are easily detected
  4. Maintenance - Browser updates, crashes, timeouts

API Interception Method

The Smart Approach

Many JavaScript sites fetch data from REST APIs. If you can find these APIs, you can skip rendering entirely.

Finding Hidden APIs

Step 1: Open DevTools Network Tab

text
1. Open Chrome DevTools (F12)
2. Go to Network tab
3. Filter by "Fetch/XHR"
4. Reload the page
5. Look for API calls

Step 2: Analyze API Requests

text
Common patterns:
- /api/v1/products
- /graphql
- /_next/data/...
- /wp-json/...

Step 3: Replicate the Request

python
import requests

# Direct API call (much faster than rendering!)
response = requests.get(
    'https://store.com/api/products',
    headers={
        'Accept': 'application/json',
        'X-Requested-With': 'XMLHttpRequest'
    }
)
products = response.json()

When This Doesn't Work

  • API requires authentication
  • API uses encryption/obfuscation
  • GraphQL with complex queries
  • Rate limited aggressively

Wait Strategies

When using headless browsers, knowing when content is ready is crucial.

Wait Strategy Comparison

StrategyUse CaseReliability
Fixed timeoutSimple pagesLow
Selector waitKnown elementsHigh
Network idleComplete loadingHigh
Custom functionComplex conditionsHighest

Implementation Examples

Wait for Selector:

python
# Wait for specific element to appear
page.wait_for_selector('.product-list', timeout=30000)

Wait for Network Idle:

python
# Wait until no network requests for 500ms
page.wait_for_load_state('networkidle')

Wait for Custom Condition:

python
# Wait until 10 products are loaded
page.wait_for_function(
    'document.querySelectorAll(".product").length >= 10'
)

Wait for Specific Text:

python
# Wait until "Loading" disappears
page.wait_for_function(
    '!document.body.innerText.includes("Loading...")'
)

The LucidExtractor Solution

LucidExtractor handles all JavaScript rendering complexity automatically.

Simple API Call

python
import requests

response = requests.post(
    'https://api.lucidextractor.com/v1/scrape',
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    json={
        'url': 'https://react-website.com/products',
        'render_js': True,  # Enable JS rendering
        'wait_for': '.product-list',  # Wait for content
        'timeout': 30000
    }
)

data = response.json()
print(data['content'])  # Fully rendered HTML

Advanced Options

python
response = requests.post(
    'https://api.lucidextractor.com/v1/scrape',
    json={
        'url': 'https://complex-spa.com',
        'render_js': True,
        
        # Wait strategies
        'wait_for': '.data-loaded',
        'wait_for_timeout': 5000,  # Additional wait
        
        # Handle infinite scroll
        'scroll_to_bottom': True,
        'scroll_delay': 1000,
        
        # Execute custom JavaScript
        'execute_js': 'document.querySelector(".load-more").click()',
        
        # Extract structured data
        'extract': {
            'products': {
                'selector': '.product',
                'type': 'list',
                'fields': {
                    'name': '.title',
                    'price': '.price',
                    'rating': '.stars@data-rating'
                }
            }
        }
    }
)

Why LucidExtractor for JS Sites?

ChallengeLucidExtractor Solution
Browser infrastructureManaged cloud browsers
Detection/blockingStealth mode + residential proxies
Memory/scalingServerless, scales instantly
Wait timingSmart auto-detection
MaintenanceZero maintenance required

Real-World Examples

Example 1: Scraping a React E-commerce Site

python
import requests

def scrape_shopify_store(store_url):
    response = requests.post(
        'https://api.lucidextractor.com/v1/scrape',
        headers={'Authorization': 'Bearer YOUR_API_KEY'},
        json={
            'url': f'{store_url}/collections/all',
            'render_js': True,
            'wait_for': '.product-grid',
            'extract': {
                'products': {
                    'selector': '.product-card',
                    'type': 'list',
                    'fields': {
                        'name': '.product-title',
                        'price': '.product-price',
                        'image': 'img@src',
                        'link': 'a@href'
                    }
                }
            }
        }
    )
    return response.json()['data']['products']

# Usage
products = scrape_shopify_store('https://example-store.myshopify.com')
print(f"Found {len(products)} products")

Example 2: Vue.js Dashboard Data

python
def scrape_vue_dashboard(dashboard_url, auth_token):
    response = requests.post(
        'https://api.lucidextractor.com/v1/scrape',
        headers={'Authorization': 'Bearer YOUR_API_KEY'},
        json={
            'url': dashboard_url,
            'render_js': True,
            'headers': {
                'Authorization': f'Bearer {auth_token}'
            },
            'wait_for': '[data-v-]',  # Vue component indicator
            'wait_for_timeout': 3000,
            'extract': {
                'metrics': {
                    'selector': '.metric-card',
                    'type': 'list',
                    'fields': {
                        'label': '.metric-label',
                        'value': '.metric-value'
                    }
                }
            }
        }
    )
    return response.json()['data']['metrics']

Example 3: Infinite Scroll Page

python
def scrape_infinite_scroll(url, max_items=100):
    response = requests.post(
        'https://api.lucidextractor.com/v1/scrape',
        headers={'Authorization': 'Bearer YOUR_API_KEY'},
        json={
            'url': url,
            'render_js': True,
            'scroll_to_bottom': True,
            'scroll_count': 10,  # Scroll 10 times
            'scroll_delay': 2000,  # Wait 2s between scrolls
            'wait_for_function': f'document.querySelectorAll(".item").length >= {max_items}',
            'extract': {
                'items': {
                    'selector': '.item',
                    'type': 'list'
                }
            }
        }
    )
    return response.json()['data']['items'][:max_items]

Conclusion

JavaScript-rendered websites are no longer a barrier to data extraction. Whether you choose:

  • API Interception for direct data access
  • Headless Browsers for learning and simple projects
  • LucidExtractor for production-ready scraping

The key is choosing the right tool for your needs.

LucidExtractor eliminates the complexity of JavaScript rendering:

  • ✅ No browser infrastructure to manage
  • ✅ Automatic wait strategies
  • ✅ Stealth mode to avoid detection
  • ✅ Scales from 1 to millions of pages

Ready to scrape any JavaScript website? Start with 500 free credits →

Try it on a page you care about

500 free credits every month. No card needed, and every feature is included.

Start free Read the docs

Keep reading

Tutorials

Give Claude Code, Cursor or Claude Desktop Live Web Access with MCP

3 min read
Tutorials

How to Bypass Cloudflare & Anti-Bot Protection: Ethical Scraping Guide 2026

14 min read