{"data":{"id":107,"slug":"extracting-json-ld-from-product-pages-part-6-107","title":"Extracting JSON-LD from product pages, part 6","excerpt":"In part 6 we take the ideas from earlier instalments and apply them to a larger, messier site. Many product pages already contain a clean, structured description of themselves in a script tag meant…","seriesName":"Extracting JSON-LD from product pages","seriesPart":6,"sections":[{"heading":"Introduction","paragraphs":["In part 6 we take the ideas from earlier instalments and apply them to a larger, messier site. Many product pages already contain a clean, structured description of themselves in a script tag meant for search engines. Reading it is often more reliable than parsing the visible HTML."]},{"heading":"Putting it into practice","paragraphs":["Write small, focused tests for your parsers using saved HTML fixtures. They run in milliseconds and catch layout changes long before a full crawl would.","Character encodings still cause trouble. Decode responses using the charset the server declares, and normalise text before comparing or storing it.","Be careful with relative URLs. Resolve every link against the page it came from, not against the site root, or you will request pages that do not exist."]},{"heading":"Going further","paragraphs":["Dynamic pages render content after the initial HTML arrives. A browser automation tool can wait for a specific element to appear, which is far more reliable than sleeping for a fixed amount of time.","Always identify your client honestly with a descriptive User-Agent, and keep your request rate modest. A crawler that behaves like a considerate visitor is far less likely to cause problems for the site operator."]},{"heading":"Key takeaway","paragraphs":["Select script[type='application/ld+json'], parse every block, and pick the one whose @type matches what you need. Fall back to HTML only for missing fields."]}],"authorId":12,"authorName":"Yuki Andersson","authorSlug":"yuki-andersson","category":"Data Engineering","tags":["ethics","scrapy"],"publishedAt":"2026-08-13T00:00:00.000Z","wordCount":213,"readingTimeMinutes":2}}