Back to feed
Dev.to
Dev.to
7/19/2026
The original title is: "Stop parsing HTML to get product data — the JSON is already in the page"

The original title is: "Stop parsing HTML to get product data — the JSON is already in the page"

Original: Stop parsing HTML to get product data — the JSON is already in the page

Short summary

Product data on e-commerce pages is almost always available as embedded JSON, making CSS selectors and headless browsers unnecessary. Three reliable sources: schema.org JSON-LD blocks (standardized but sometimes stale on stock), framework hydration state (__NEXT_DATA__, __NUXT__), and internal XHR APIs that return clean structured product JSON. The author built scrapers for dozens of retailers using these approaches with minimal selector usage.

  • JSON-LD schema.org/Product blocks provide standardized product data across unrelated sites
  • Framework hydration state (__NEXT_DATA__ etc.) contains richer data including full variant matrices
  • Internal mobile JSON APIs (e.g. SHEIN) return structured product data without any HTML parsing

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more