jshemas / openGraphScraper

Node.js scraper service for Open Graph Info and More!
MIT License
643 stars 102 forks source link

Bugfix/scrape all ld json objects #216

Closed bugkarma closed 2 months ago

bugkarma commented 3 months ago

Some pages have more than one ld+json object. This PR will add an array of all LD JSON objects while keeping backwards compatibility with the current ldJson property.

Example page with multiple LD JSON objects: https://www.homedepot.com/p/NewAir-Beverage-Froster-22-in-125-12-oz-Can-Freestanding-Cooler-Beverage-Fridge-Chills-Down-to-23-w-Party-and-Turbo-Mode-NBF125BK00/313138626

jshemas commented 3 months ago

Hello, thanks for the PR! I just added support for JSON LD in my last update and I think this is just a bug because I wasn't aware it was valid to have more then one JSON LD tag on a page. Can you reuse the existing jsonLD property?

jshemas commented 2 months ago

Hello, I need to update this package and have addressed this problem in open-graph-scraper@6.5.1. Closing this PR since it's no longer needed.