Skip to content

All tests / Hidden data

JSON in a script tag

What this tests. Twenty product pages that show a name and "Price loading…". The price, stock and variants sit in a JSON script tag the visible HTML never repeats.

The rule. Each product page shows its name and a price that says it's still loading. The real record is in <script type="application/json" id="__PAGE_DATA__">: price, stock count, SKU and every variant. Parse that and you have the lot, no browser needed. Scrape the visible text and you get twenty names and no prices.

  1. Thistlecombe Soft Plush Whale
  2. Saltgrove Woven Plush Owl
  3. Kestleford Soft Plush Bear
  4. Upwold Slim Plush Bear
  5. Saltgrove Square Plush Bear
  6. Kestleford Woven Plush Whale
  7. Saltgrove Square Plush Whale
  8. Orrin Lane Studio Plush Bear
  9. Fennick & Daw Woven Plush Owl
  10. Pellwick Square Plush Bear
  11. Ardley Fen Heavy-duty Plush Bear
  12. Hollinsgate Heavy-duty Plush Bear
  13. Quillmere Studio Plush Whale
  14. Fennick & Daw Round Plush Fox
  15. Hollinsgate Woven Plush Fox
  16. Fennick & Daw Twin Plush Fox
  17. Vexmoor Soft Plush Owl
  18. Upwold Mini Plush Whale
  19. Marrowdene Round Plush Bear
  20. Ardley Fen Tall Plush Bear

Data version 1.0.0. Everything here is made up: products, brands, people, towns. tests.json · robots.txt · Source