[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"blog-post-en-scrape-javascript-heavy-websites":3},{"success":4,"payload":5,"related":74,"errors":188},true,{"id":6,"slug":7,"title":8,"excerpt":9,"body_html":10,"meta_title":11,"meta_description":12,"canonical_url":13,"canonical_override":14,"og_title":8,"og_description":15,"og_image_url":16,"faq_json":17,"key_takeaways":30,"allow_index":36,"noindex_google_only":36,"allow_follow":4,"published_at":37,"updated_at":38,"content_updated_at":39,"featured_image_url":40,"featured_image_alt":14,"card_image_url":41,"reading_time_minutes":42,"author":43,"categories":47,"tags":54,"alternates":60,"locale_paths":72,"views":73},47,"scrape-javascript-heavy-websites","How to Scrape JavaScript-Heavy Websites","Scrape JavaScript-rendered content with headless browsers and proxies. Puppeteer, Playwright, and chromedp setup guides with performance optimization and API interception strategies.","\u003Ch2>The Challenge of JavaScript-Rendered Content\u003C\u002Fh2>\n\u003Cp>Modern websites increasingly rely on JavaScript to render content. Single-page applications (SPAs) built with React, Vue, or Angular load a minimal HTML shell, then fetch and render data client-side. When you make a simple HTTP request to these sites, you get an empty or incomplete page because the content only exists after JavaScript execution.\u003C\u002Fp>\n\u003Cp>Scraping JavaScript-heavy websites requires \u003Cstrong>headless browsers\u003C\u002Fstrong> — real browser engines running without a visible window that can execute JavaScript, render DOM, and interact with page elements. Combined with proxies, headless browsers unlock data from even the most dynamic websites.\u003C\u002Fp>\n\u003Cblockquote>This guide is part of our \u003Ca href=\"\u002Fblog\u002Fcomplete-guide-to-web-scraping-proxies\">Complete Guide to Web Scraping Proxies\u003C\u002Fa>. For avoiding detection while using headless browsers, see \u003Ca href=\"\u002Fblog\u002Fhow-anti-bot-systems-detect-proxies\">How Anti-Bot Systems Detect Proxies\u003C\u002Fa>.\u003C\u002Fblockquote>\n\u003Ch2>When Do You Need a Headless Browser?\u003C\u002Fh2>\n\u003Ctable>\n\u003Ccaption>When Do You Need a Headless Browser?\u003C\u002Fcaption>\n\u003Cthead>\n\u003Ctr>\u003Cth>Scenario\u003C\u002Fth>\u003Cth>Simple HTTP\u003C\u002Fth>\u003Cth>Headless Browser\u003C\u002Fth>\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\u003Ctd>Static HTML pages\u003C\u002Ftd>\u003Ctd>Works perfectly\u003C\u002Ftd>\u003Ctd>Overkill\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Server-rendered pages with API\u003C\u002Ftd>\u003Ctd>Works (hit the API directly)\u003C\u002Ftd>\u003Ctd>Not needed\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>SPA (React, Vue, Angular)\u003C\u002Ftd>\u003Ctd>Gets empty shell\u003C\u002Ftd>\u003Ctd>Required\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Infinite scroll \u002F lazy loading\u003C\u002Ftd>\u003Ctd>Cannot trigger\u003C\u002Ftd>\u003Ctd>Required\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Content behind login + JS\u003C\u002Ftd>\u003Ctd>Difficult\u003C\u002Ftd>\u003Ctd>Recommended\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Pages with anti-bot JS checks\u003C\u002Ftd>\u003Ctd>Fails detection\u003C\u002Ftd>\u003Ctd>Required\u003C\u002Ftd>\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cblockquote>Always check if the site has an API or server-side rendering before reaching for a headless browser. Many \"JavaScript-heavy\" sites actually have API endpoints that return clean JSON — much faster and cheaper to scrape.\u003C\u002Fblockquote>\n\u003Ch2>Puppeteer + Proxies (Node.js)\u003C\u002Fh2>\n\u003Cp>Puppeteer controls Chrome\u002FChromium programmatically. It is the most mature headless browser tool for Node.js.\u003C\u002Fp>\n\u003Ch3>Basic Setup with ProxyHat\u003C\u002Fh3>\n\u003Cpre>\u003Ccode>const puppeteer = require('puppeteer');\nasync function scrapeWithPuppeteer(url) {\n  const browser = await puppeteer.launch({\n    headless: 'new',\n    args: [\n      '--proxy-server=http:\u002F\u002Fgate.proxyhat.com:8080',\n      '--no-sandbox',\n      '--disable-setuid-sandbox',\n      '--disable-dev-shm-usage',\n    ],\n  });\n  const page = await browser.newPage();\n  \u002F\u002F Authenticate with proxy\n  await page.authenticate({\n    username: 'USERNAME',\n    password: 'PASSWORD',\n  });\n  \u002F\u002F Set realistic viewport and user agent\n  await page.setViewport({ width: 1920, height: 1080 });\n  await page.setUserAgent(\n    'Mozilla\u002F5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\u002F537.36 ' +\n    '(KHTML, like Gecko) Chrome\u002F120.0.0.0 Safari\u002F537.36'\n  );\n  try {\n    await page.goto(url, { waitUntil: 'networkidle2', timeout: 60000 });\n    \u002F\u002F Wait for specific content to render\n    await page.waitForSelector('.product-list', { timeout: 10000 });\n    const content = await page.content();\n    const data = await page.evaluate(() => {\n      return Array.from(document.querySelectorAll('.product-item')).map(el => ({\n        name: el.querySelector('.product-name')?.textContent?.trim(),\n        price: el.querySelector('.product-price')?.textContent?.trim(),\n        url: el.querySelector('a')?.href,\n      }));\n    });\n    return { html: content, data };\n  } finally {\n    await browser.close();\n  }\n}\n\u002F\u002F Usage\nconst result = await scrapeWithPuppeteer('https:\u002F\u002Fexample.com\u002Fproducts');\nconsole.log(`Found ${result.data.length} products`);\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch3>Optimized Multi-Page Scraping\u003C\u002Fh3>\n\u003Cpre>\u003Ccode>const puppeteer = require('puppeteer');\nclass PuppeteerScraper {\n  constructor(concurrency = 3) {\n    this.concurrency = concurrency;\n    this.browser = null;\n  }\n  async init() {\n    this.browser = await puppeteer.launch({\n      headless: 'new',\n      args: [\n        '--proxy-server=http:\u002F\u002Fgate.proxyhat.com:8080',\n        '--no-sandbox',\n        '--disable-setuid-sandbox',\n        '--disable-dev-shm-usage',\n        '--disable-gpu',\n        '--disable-extensions',\n      ],\n    });\n  }\n  async scrapePage(url) {\n    const page = await this.browser.newPage();\n    await page.authenticate({ username: 'USERNAME', password: 'PASSWORD' });\n    await page.setViewport({ width: 1920, height: 1080 });\n    \u002F\u002F Block unnecessary resources to speed up loading\n    await page.setRequestInterception(true);\n    page.on('request', (req) => {\n      const type = req.resourceType();\n      if (['image', 'stylesheet', 'font', 'media'].includes(type)) {\n        req.abort();\n      } else {\n        req.continue();\n      }\n    });\n    try {\n      await page.goto(url, { waitUntil: 'networkidle2', timeout: 30000 });\n      const content = await page.content();\n      return { url, status: 'success', html: content };\n    } catch (err) {\n      return { url, status: 'error', error: err.message };\n    } finally {\n      await page.close();\n    }\n  }\n  async scrapeMany(urls) {\n    const results = [];\n    for (let i = 0; i \u003C urls.length; i += this.concurrency) {\n      const batch = urls.slice(i, i + this.concurrency);\n      const batchResults = await Promise.all(\n        batch.map(url => this.scrapePage(url))\n      );\n      results.push(...batchResults);\n      console.log(`Progress: ${results.length}\u002F${urls.length}`);\n    }\n    return results;\n  }\n  async close() {\n    if (this.browser) await this.browser.close();\n  }\n}\n\u002F\u002F Usage\nconst scraper = new PuppeteerScraper(3);\nawait scraper.init();\nconst results = await scraper.scrapeMany(urls);\nawait scraper.close();\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2>Playwright + Proxies (Python)\u003C\u002Fh2>\n\u003Cp>Playwright is a newer alternative that supports Chromium, Firefox, and WebKit. Its Python API is clean and well-suited for scraping.\u003C\u002Fp>\n\u003Ch3>Basic Setup\u003C\u002Fh3>\n\u003Cpre>\u003Ccode>from playwright.sync_api import sync_playwright\ndef scrape_with_playwright(url: str) -> dict:\n    \"\"\"Scrape a JavaScript-heavy page using Playwright with ProxyHat proxy.\"\"\"\n    with sync_playwright() as p:\n        browser = p.chromium.launch(\n            headless=True,\n            proxy={\n                \"server\": \"http:\u002F\u002Fgate.proxyhat.com:8080\",\n                \"username\": \"USERNAME\",\n                \"password\": \"PASSWORD\",\n            }\n        )\n        context = browser.new_context(\n            viewport={\"width\": 1920, \"height\": 1080},\n            user_agent=\"Mozilla\u002F5.0 (Windows NT 10.0; Win64; x64) \"\n                       \"AppleWebKit\u002F537.36 (KHTML, like Gecko) \"\n                       \"Chrome\u002F120.0.0.0 Safari\u002F537.36\",\n        )\n        page = context.new_page()\n        try:\n            page.goto(url, wait_until=\"networkidle\", timeout=60000)\n            # Wait for dynamic content\n            page.wait_for_selector(\".product-list\", timeout=10000)\n            # Extract data using page.evaluate\n            products = page.evaluate(\"\"\"() => {\n                return Array.from(document.querySelectorAll('.product-item')).map(el => ({\n                    name: el.querySelector('.product-name')?.textContent?.trim(),\n                    price: el.querySelector('.product-price')?.textContent?.trim(),\n                    url: el.querySelector('a')?.href,\n                }));\n            }\"\"\")\n            return {\"url\": url, \"products\": products, \"html\": page.content()}\n        finally:\n            browser.close()\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch3>Async Playwright for Parallel Scraping\u003C\u002Fh3>\n\u003Cpre>\u003Ccode>import asyncio\nfrom playwright.async_api import async_playwright\nasync def scrape_batch(urls: list[str], concurrency: int = 3) -> list[dict]:\n    \"\"\"Scrape multiple JS-heavy pages in parallel using Playwright.\"\"\"\n    results = []\n    async with async_playwright() as p:\n        browser = await p.chromium.launch(\n            headless=True,\n            proxy={\n                \"server\": \"http:\u002F\u002Fgate.proxyhat.com:8080\",\n                \"username\": \"USERNAME\",\n                \"password\": \"PASSWORD\",\n            }\n        )\n        semaphore = asyncio.Semaphore(concurrency)\n        async def scrape_one(url: str) -> dict:\n            async with semaphore:\n                context = await browser.new_context(\n                    viewport={\"width\": 1920, \"height\": 1080},\n                )\n                page = await context.new_page()\n                # Block heavy resources\n                await page.route(\"**\u002F*.{png,jpg,jpeg,gif,svg,css,woff,woff2}\",\n                                 lambda route: route.abort())\n                try:\n                    await page.goto(url, wait_until=\"networkidle\", timeout=30000)\n                    html = await page.content()\n                    return {\"url\": url, \"status\": \"success\", \"html\": html}\n                except Exception as e:\n                    return {\"url\": url, \"status\": \"error\", \"error\": str(e)}\n                finally:\n                    await context.close()\n        tasks = [scrape_one(url) for url in urls]\n        results = await asyncio.gather(*tasks)\n        await browser.close()\n    return results\n# Usage\nurls = [f\"https:\u002F\u002Fexample.com\u002Fproduct\u002F{i}\" for i in range(50)]\nresults = asyncio.run(scrape_batch(urls, concurrency=5))\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2>Go: Using chromedp with Proxies\u003C\u002Fh2>\n\u003Cpre>\u003Ccode>package main\nimport (\n    \"context\"\n    \"fmt\"\n    \"log\"\n    \"time\"\n    \"github.com\u002Fchromedp\u002Fchromedp\"\n)\nfunc scrapeJSPage(targetURL string) (string, error) {\n    \u002F\u002F Configure proxy\n    opts := append(chromedp.DefaultExecAllocatorOptions[:],\n        chromedp.ProxyServer(\"http:\u002F\u002Fgate.proxyhat.com:8080\"),\n        chromedp.Flag(\"headless\", true),\n        chromedp.Flag(\"disable-gpu\", true),\n        chromedp.Flag(\"no-sandbox\", true),\n        chromedp.UserAgent(\"Mozilla\u002F5.0 (Windows NT 10.0; Win64; x64) \"+\n            \"AppleWebKit\u002F537.36 (KHTML, like Gecko) Chrome\u002F120.0.0.0 Safari\u002F537.36\"),\n    )\n    allocCtx, cancel := chromedp.NewExecAllocator(context.Background(), opts...)\n    defer cancel()\n    ctx, cancel := chromedp.NewContext(allocCtx)\n    defer cancel()\n    ctx, cancel = context.WithTimeout(ctx, 60*time.Second)\n    defer cancel()\n    var htmlContent string\n    err := chromedp.Run(ctx,\n        chromedp.Navigate(targetURL),\n        chromedp.WaitVisible(\".product-list\", chromedp.ByQuery),\n        chromedp.OuterHTML(\"html\", &htmlContent),\n    )\n    if err != nil {\n        return \"\", fmt.Errorf(\"scrape failed: %w\", err)\n    }\n    return htmlContent, nil\n}\nfunc main() {\n    html, err := scrapeJSPage(\"https:\u002F\u002Fexample.com\u002Fproducts\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    fmt.Printf(\"Got %d bytes of rendered HTML\\n\", len(html))\n}\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2>Performance Optimization Strategies\u003C\u002Fh2>\n\u003Cp>Headless browsers are 10-50x slower than simple HTTP requests. Here are strategies to minimize the performance gap:\u003C\u002Fp>\n\u003Ch3>1. Block Unnecessary Resources\u003C\u002Fh3>\n\u003Cp>Images, CSS, fonts, and media files are not needed for data extraction. Blocking them dramatically speeds up page loads:\u003C\u002Fp>\n\u003Cpre>\u003Ccode># Playwright resource blocking\nasync def fast_scrape(page, url):\n    # Block images, CSS, fonts, media\n    await page.route(\"**\u002F*.{png,jpg,jpeg,gif,svg,css,woff,woff2,mp4,webm}\",\n                     lambda route: route.abort())\n    # Also block tracking scripts\n    await page.route(\"**\u002F*google-analytics*\", lambda route: route.abort())\n    await page.route(\"**\u002F*facebook*\", lambda route: route.abort())\n    await page.goto(url, wait_until=\"domcontentloaded\")  # Faster than networkidle\n    return await page.content()\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch3>2. Use the Right Wait Strategy\u003C\u002Fh3>\n\u003Ctable>\n\u003Ccaption>2. Use the Right Wait Strategy\u003C\u002Fcaption>\n\u003Cthead>\n\u003Ctr>\u003Cth>Strategy\u003C\u002Fth>\u003Cth>Speed\u003C\u002Fth>\u003Cth>Reliability\u003C\u002Fth>\u003Cth>Use Case\u003C\u002Fth>\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\u003Ctd>\u003Ccode>domcontentloaded\u003C\u002Fcode>\u003C\u002Ftd>\u003Ctd>Fast\u003C\u002Ftd>\u003Ctd>May miss async data\u003C\u002Ftd>\u003Ctd>Pages with inline data\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>\u003Ccode>load\u003C\u002Fcode>\u003C\u002Ftd>\u003Ctd>Medium\u003C\u002Ftd>\u003Ctd>Good\u003C\u002Ftd>\u003Ctd>Most pages\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>\u003Ccode>networkidle\u003C\u002Fcode>\u003C\u002Ftd>\u003Ctd>Slow\u003C\u002Ftd>\u003Ctd>Highest\u003C\u002Ftd>\u003Ctd>Heavy SPAs, infinite scroll\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Specific selector\u003C\u002Ftd>\u003Ctd>Variable\u003C\u002Ftd>\u003Ctd>Highest\u003C\u002Ftd>\u003Ctd>When you know the target element\u003C\u002Ftd>\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Ch3>3. Reuse Browser Instances\u003C\u002Fh3>\n\u003Cp>Launching a browser takes 1-3 seconds. For batch scraping, launch once and create new pages\u002Fcontexts for each URL:\u003C\u002Fp>\n\u003Cpre>\u003Ccode>from playwright.sync_api import sync_playwright\nclass BrowserPool:\n    \"\"\"Reusable browser pool for efficient headless scraping.\"\"\"\n    def __init__(self, pool_size: int = 3):\n        self.pool_size = pool_size\n        self.playwright = None\n        self.browsers = []\n    def start(self):\n        self.playwright = sync_playwright().start()\n        for _ in range(self.pool_size):\n            browser = self.playwright.chromium.launch(\n                headless=True,\n                proxy={\n                    \"server\": \"http:\u002F\u002Fgate.proxyhat.com:8080\",\n                    \"username\": \"USERNAME\",\n                    \"password\": \"PASSWORD\",\n                }\n            )\n            self.browsers.append(browser)\n    def get_browser(self, index: int):\n        return self.browsers[index % self.pool_size]\n    def stop(self):\n        for browser in self.browsers:\n            browser.close()\n        self.playwright.stop()\n# Usage\npool = BrowserPool(pool_size=3)\npool.start()\nfor i, url in enumerate(urls):\n    browser = pool.get_browser(i)\n    context = browser.new_context()\n    page = context.new_page()\n    page.goto(url, wait_until=\"networkidle\")\n    html = page.content()\n    context.close()\npool.stop()\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch3>4. Intercept API Calls Instead of Parsing DOM\u003C\u002Fh3>\n\u003Cp>Many SPAs fetch data from APIs. Intercept those API calls directly — you get clean JSON without parsing HTML:\u003C\u002Fp>\n\u003Cpre>\u003Ccode>const puppeteer = require('puppeteer');\nasync function interceptAPIData(url) {\n  const browser = await puppeteer.launch({\n    headless: 'new',\n    args: ['--proxy-server=http:\u002F\u002Fgate.proxyhat.com:8080'],\n  });\n  const page = await browser.newPage();\n  await page.authenticate({ username: 'USERNAME', password: 'PASSWORD' });\n  const apiResponses = [];\n  \u002F\u002F Intercept XHR\u002Ffetch responses\n  page.on('response', async (response) => {\n    const url = response.url();\n    if (url.includes('\u002Fapi\u002F') || url.includes('\u002Fgraphql')) {\n      try {\n        const json = await response.json();\n        apiResponses.push({ url, data: json });\n      } catch {\n        \u002F\u002F Not JSON, skip\n      }\n    }\n  });\n  await page.goto(url, { waitUntil: 'networkidle2' });\n  await browser.close();\n  return apiResponses;\n}\n\u002F\u002F Get clean API data instead of scraping DOM\nconst data = await interceptAPIData('https:\u002F\u002Fexample.com\u002Fproducts');\nconsole.log(`Intercepted ${data.length} API calls`);\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2>Headless Browser vs HTTP Comparison\u003C\u002Fh2>\n\u003Ctable>\n\u003Ccaption>Headless Browser vs HTTP Comparison\u003C\u002Fcaption>\n\u003Cthead>\n\u003Ctr>\u003Cth>Metric\u003C\u002Fth>\u003Cth>Simple HTTP + Proxy\u003C\u002Fth>\u003Cth>Headless Browser + Proxy\u003C\u002Fth>\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\u003Ctd>Speed per page\u003C\u002Ftd>\u003Ctd>0.5-2 seconds\u003C\u002Ftd>\u003Ctd>3-15 seconds\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Memory per instance\u003C\u002Ftd>\u003Ctd>~50 MB\u003C\u002Ftd>\u003Ctd>200-500 MB\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>CPU usage\u003C\u002Ftd>\u003Ctd>Minimal\u003C\u002Ftd>\u003Ctd>Significant\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Bandwidth per page\u003C\u002Ftd>\u003Ctd>50-200 KB\u003C\u002Ftd>\u003Ctd>2-10 MB (with resources)\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>JavaScript rendering\u003C\u002Ftd>\u003Ctd>No\u003C\u002Ftd>\u003Ctd>Full\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Anti-bot bypass\u003C\u002Ftd>\u003Ctd>Limited\u003C\u002Ftd>\u003Ctd>Better (real browser)\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Concurrent pages\u003C\u002Ftd>\u003Ctd>100+\u003C\u002Ftd>\u003Ctd>3-10 per machine\u003C\u002Ftd>\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Ch2>Best Practices\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>\u003Cstrong>Always try HTTP first.\u003C\u002Fstrong> Check for API endpoints, server-rendered content, or JSON embedded in the HTML before using a headless browser.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Block unnecessary resources.\u003C\u002Fstrong> Images, CSS, and fonts add load time without providing data.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Use specific selectors for waiting.\u003C\u002Fstrong> \u003Ccode>networkidle\u003C\u002Fcode> is safe but slow. Wait for the specific element you need.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Reuse browser instances.\u003C\u002Fstrong> Launch once, create new contexts per page.\u003C\u002Fli>\n\u003Cli>Intercept API calls. Many SPAs load data via APIs — intercept the JSON directly.\u003C\u002Fli>\n\u003Cli>Limit concurrency. Headless browsers are memory-intensive. 3-5 concurrent pages per GB of RAM is a good rule.\u003C\u002Fli>\n\u003Cli>Use residential proxies. \u003Ca href=\"\u002Fpricing\">ProxyHat residential proxies\u003C\u002Fa> provide the highest trust scores, reducing detection when running headless browsers.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>For handling CAPTCHAs that headless browsers encounter, see \u003Ca href=\"\u002Fblog\u002Fhandling-captchas-when-scraping\">Handling CAPTCHAs When Scraping\u003C\u002Fa>. For scaling headless browser scraping, read \u003Ca href=\"\u002Fblog\u002Fscale-scraping-infrastructure\">How to Scale Scraping Infrastructure\u003C\u002Fa>.\u003C\u002Fp>\n\u003Cp>Get started with the \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FProxyHatCom\u002Fpython-sdk\" rel=\"noopener noreferrer\">Python SDK\u003C\u002Fa>, \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FProxyHatCom\u002Fnode-sdk\" rel=\"noopener noreferrer\">Node SDK\u003C\u002Fa>, or \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FProxyHatCom\u002Fgo-sdk\" rel=\"noopener noreferrer\">Go SDK\u003C\u002Fa> for proxy integration, and explore \u003Ca href=\"\u002Fuse-cases\u002Fweb-scraping\">ProxyHat for Web Scraping\u003C\u002Fa>.\u003C\u002Fp>","How to Scrape JavaScript Websites","Learn to scrape JavaScript-heavy websites with headless browsers and proxies. Puppeteer, Playwright, and Go setup with performance optimization strategies.","\u002Fblog\u002Fscrape-javascript-heavy-websites",null,"Scrape JS websites with headless browsers and proxies. Puppeteer, Playwright setup and performance optimization.","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog\u002Fscrape-javascript-heavy-websites-og.webp",[18,21,24,27],{"question":19,"answer":20},"Do I always need a headless browser for JavaScript sites?","No. Many JS sites load data from APIs. Check the Network tab for XHR\u002Ffetch requests — if data comes from an API, call it directly with HTTP.",{"question":22,"answer":23},"Puppeteer or Playwright — which is better?","Playwright is generally recommended for new projects. It supports multiple browser engines (Chromium, Firefox, WebKit), has better auto-waiting, native async support in Python, and built-in proxy configuration. Puppeteer is more mature and has a larger ecosystem if you are in the Node.js world.",{"question":25,"answer":26},"How many headless pages can I run concurrently?","Each page consumes 200-500 MB of RAM. On a machine with 8 GB RAM, 3-10 concurrent pages is realistic. Use resource blocking (images, CSS) to reduce memory. For higher concurrency, distribute across multiple machines using a queue-based architecture.",{"question":28,"answer":29},"Why use proxies with headless browsers?","Even with a real browser, repeated requests from the same IP get blocked. Proxies rotate your IP so each page load appears to come from a different user. Residential proxies through ProxyHat provide the highest trust scores, minimizing blocks and CAPTCHAs.",[31,32,33,34,35],"Always check for hidden API endpoints or server-side rendering before using a headless browser, as they are much faster and cheaper to scrape.","Use headless browsers like Puppeteer or Playwright combined with proxies to scrape dynamic JavaScript-heavy websites like SPAs.","Block unnecessary resources such as images, CSS, and fonts to dramatically speed up page loading times in headless browsers.","Reuse browser instances and choose the right wait strategy (like specific selectors) to optimize batch scraping performance.","Intercept XHR\u002Ffetch API calls directly to get clean JSON data instead of parsing the rendered DOM.",false,"2026-02-21T10:07:49+00:00","2026-07-19T03:13:07+00:00","2026-02-25T23:59:15+00:00","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog\u002Fscrape-javascript-heavy-websites-master.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog\u002Fscrape-javascript-heavy-websites-card.webp",10,{"name":44,"slug":45,"bio":46,"avatar_url":14,"website_url":14,"social_links":14},"ProxyHat Team","proxyhat-team","The ProxyHat editorial team covers proxies, web scraping, and data extraction.",[48],{"id":49,"slug":50,"name":51,"description":14,"meta_title":52,"meta_description":53,"parent_id":14},1,"web-scraping","Web Scraping","Web Scraping Guides & Tips | ProxyHat Blog","Learn web scraping techniques, proxy strategies, and data extraction best practices.",[55,56],{"id":49,"slug":50,"name":51},{"id":57,"slug":58,"name":59},21,"headless-browser","Headless Browser",{"de":61,"tr":62,"fr":63,"en":13,"ru":64,"zh":65,"pl":66,"ja":67,"it":68,"es":69,"ko":70,"pt":71,"x-default":13},"\u002Fde\u002Fblog\u002Fjavascript-lastige-websites-scrapen","\u002Ftr\u002Fblog\u002Fjavascript-agirlikli-siteleri-scraping","\u002Ffr\u002Fblog\u002Fscraper-les-sites-web-javascript-heavy","\u002Fru\u002Fblog\u002Fskraping-saytov-s-javascript","\u002Fcn\u002Fblog\u002Fcaiji-javascript-zhongdu-wangzhan","\u002Fpl\u002Fblog\u002Fjak-scrape-javascript-ciezkie-strony-internetowe","\u002Fja\u002Fblog\u002Fjavascript-takai-web-saito-no-sukureipingu","\u002Fit\u002Fblog\u002Fcome-scrape-javascript-heavy-siti-web","\u002Fes\u002Fblog\u002Fscrapear-sitios-web-con-mucho-javascript","\u002Fko\u002Fblog\u002Fjavascript-heavy-website-scraping","\u002Fpt\u002Fblog\u002Fcomo-fazer-scraping-sites-pesados-em-javascript",{"de":61,"tr":62,"fr":63,"en":13,"ru":64,"zh":65,"pl":66,"ja":67,"it":68,"es":69,"ko":70,"pt":71},258,[75,111,136,166],{"id":76,"slug":77,"title":78,"excerpt":79,"featured_image_url":80,"featured_image_alt":78,"card_image_url":81,"og_image_url":82,"published_at":83,"updated_at":84,"content_updated_at":85,"reading_time_minutes":86,"is_featured":36,"indexable":4,"views":87,"author":88,"categories":89,"tags":96},206,"camoufox-residential-proxies-python-guide","Camoufox with Residential Proxies: A Code-First Python Guide","How to run Camoufox, the C++-patched Firefox, behind residential proxies: current Python API, why geoip needs a sticky session, a fingerprint coherence checklist, and when Patchright or nodriver fits better.","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Fcamoufox-residential-proxies-python-guide-master.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Fcamoufox-residential-proxies-python-guide-card.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Fcamoufox-residential-proxies-python-guide-og.webp","2026-10-13T09:00:00+00:00","2026-10-13T09:00:22+00:00","2026-10-03T09:31:26+00:00",14,44,{"name":44,"slug":45,"bio":46,"avatar_url":14,"website_url":14,"social_links":14},[90],{"id":91,"slug":92,"name":93,"description":14,"meta_title":94,"meta_description":95,"parent_id":14},4,"developer-guides","Developer Guides","Developer Guides | ProxyHat Blog","Code tutorials and SDK guides for integrating proxies into your applications.",[97,98,102,103,107],{"id":49,"slug":50,"name":51},{"id":99,"slug":100,"name":101},6,"anti-detection","Anti-Detection",{"id":57,"slug":58,"name":59},{"id":104,"slug":105,"name":106},9,"python","Python",{"id":108,"slug":109,"name":110},2,"residential-proxies","Residential Proxies",{"id":112,"slug":113,"title":114,"excerpt":115,"featured_image_url":116,"featured_image_alt":14,"card_image_url":117,"og_image_url":118,"published_at":119,"updated_at":38,"content_updated_at":120,"reading_time_minutes":42,"is_featured":36,"indexable":36,"views":121,"author":122,"categories":123,"tags":129},39,"headless-browsers-proxies-setup","Headless Browsers + Proxies: Complete Setup Guide for Puppeteer and Playwright","Step-by-step guide to configuring Puppeteer and Playwright with proxy rotation, stealth plugins, device emulation, and concurrent scraping patterns using residential proxies.","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog\u002Fheadless-browsers-proxies-setup-master.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog\u002Fheadless-browsers-proxies-setup-card.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog\u002Fheadless-browsers-proxies-setup-og.webp","2026-02-12T15:02:24+00:00","2026-10-03T08:21:22+00:00",225,{"name":44,"slug":45,"bio":46,"avatar_url":14,"website_url":14,"social_links":14},[124],{"id":99,"slug":125,"name":126,"description":14,"meta_title":127,"meta_description":128,"parent_id":14},"anti-bot-security","Anti-Bot & Security","Anti-Bot & Security Guides | ProxyHat Blog","Technical deep dives into anti-bot systems, detection evasion, and proxy security.",[130,134,135],{"id":131,"slug":132,"name":133},16,"anti-bot","Anti-Bot",{"id":57,"slug":58,"name":59},{"id":49,"slug":50,"name":51},{"id":137,"slug":138,"title":139,"excerpt":140,"featured_image_url":141,"featured_image_alt":139,"card_image_url":142,"og_image_url":143,"published_at":144,"updated_at":145,"content_updated_at":85,"reading_time_minutes":131,"is_featured":36,"indexable":4,"views":87,"author":146,"categories":147,"tags":154},215,"tiktok-shop-product-data-research","Collecting TikTok Shop Product Data for Market Research","Official routes first: what the TikTok Shop Partner API and Research API really expose, when licensed data wins, and how to read public product pages slowly and in the right market.","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Ftiktok-shop-product-data-research-master.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Ftiktok-shop-product-data-research-card.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Ftiktok-shop-product-data-research-og.webp","2026-10-29T09:00:00+00:00","2026-10-29T09:00:19+00:00",{"name":44,"slug":45,"bio":46,"avatar_url":14,"website_url":14,"social_links":14},[148],{"id":149,"slug":150,"name":151,"description":14,"meta_title":152,"meta_description":153,"parent_id":14},5,"ecommerce","E-commerce & Competitive Intelligence","E-commerce Scraping Guides | ProxyHat Blog","Guides on scraping e-commerce data, monitoring prices, and competitive intelligence with proxies.",[155,157,158,162],{"id":86,"slug":150,"name":156},"E-commerce",{"id":49,"slug":50,"name":51},{"id":159,"slug":160,"name":161},15,"price-monitoring","Price Monitoring",{"id":163,"slug":164,"name":165},18,"geo-targeting","Geo-Targeting",{"id":167,"slug":168,"title":169,"excerpt":170,"featured_image_url":171,"featured_image_alt":169,"card_image_url":172,"og_image_url":173,"published_at":174,"updated_at":175,"content_updated_at":85,"reading_time_minutes":86,"is_featured":36,"indexable":4,"views":176,"author":177,"categories":178,"tags":180},210,"proxy-setup-for-ai-agents","Proxy Setup for AI Agents: browser-use, Crawl4AI and an MCP Server","Agents on cloud VMs exit from datacenter IPs. Here is current, working proxy configuration for browser-use, Crawl4AI and an MCP server, with a sticky-vs-rotating decision table and the cost traps to avoid.","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Fproxy-setup-for-ai-agents-master.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Fproxy-setup-for-ai-agents-card.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Fproxy-setup-for-ai-agents-og.webp","2026-10-24T09:00:00+00:00","2026-10-24T09:00:20+00:00",31,{"name":44,"slug":45,"bio":46,"avatar_url":14,"website_url":14,"social_links":14},[179],{"id":91,"slug":92,"name":93,"description":14,"meta_title":94,"meta_description":95,"parent_id":14},[181,182,183,184],{"id":49,"slug":50,"name":51},{"id":108,"slug":109,"name":110},{"id":104,"slug":105,"name":106},{"id":185,"slug":186,"name":187},22,"playwright","Playwright",[]]