Search code examples
javascripthtmlsocial-media

Display the social media preview of another site


I'm building a site which will preview recipes from a couple of other sites (allrecipes, yummly, etc) to users. How can I show a preview of a linked page (for example https://www.yummly.com/recipe/Baked-Zucchini-Chips-9092209)?

I read this post about using iFrame, but that option doesn't display well. Ideally I'd like to grab the preview that the site specified for their social media preview. Is scraping my only option?


Solution

  • Found this wonderful little package which does exactly what I need and is not limited to any one recipe site: https://pypi.org/project/opengraph-parse/