Can I See the XHR / AJAX / Fetch Requests that Browsers Perform?
If you need to capture dynamic content loaded via AJAX requests, ZenRows offers different approaches depending on the product you’re using. Some products provide built-in JSON responses, while others require custom configurations to extract network requests.
More and more websites load content dynamically, meaning data is fetched via XHR, AJAX, or Fetch requests instead of being included in the initial HTML. Besides waiting for the content to load, you might want to capture these network requests—similar to how they appear in the Network tab in DevTools.
How Each ZenRows Product Handles XHR / AJAX / Fetch Requests
Universal Scraper API
- The JSON Response feature (
json_response=true
) captures AJAX requests automatically. - Returns a structured JSON object containing two fields:
- HTML – The final rendered page source.
- XHR – An array of network requests (XHR, AJAX, Fetch), including URL, body, headers, and more.
- This feature is exclusive to the Universal Scraper API and is ideal for analyzing background requests.
Scraper APIs
- Default response format is JSON, but it does not include network requests by default.
- Instead of capturing XHR calls, it extracts and structures the final page content into a JSON format.
- This means you’ll get structured data rather than raw network request details.
Scraping Browser
- Does not capture network requests automatically.
- You’ll need to configure custom JavaScript code to intercept and extract XHR/AJAX calls manually on Puppeteer or Playwright.
Residential Proxies
- Acts as a proxy layer without modifying responses.
- To capture XHR/AJAX requests, you must configure custom request logging in your own setup (e.g., Puppeteer, Playwright, or Selenium).
By choosing the right ZenRows product and configuration, you can effectively capture network requests and analyze the data that websites load dynamically. Let us know if you need guidance on a specific use case! 🚀
Was this page helpful?