microlinkhq / metascraper

Get unified metadata from websites using Open Graph, Microdata, RDFa, Twitter Cards, JSON-LD, HTML, and more.
https://metascraper.js.org
MIT License
2.35k stars 168 forks source link

Fail to get image from the app #627

Closed m-rolana closed 1 year ago

m-rolana commented 1 year ago

Prerequisites

Subject of the issue

Fail to get image from the app https://app.maze.co. Now image = undefined. Example of link https://app.maze.co/report/New-maze-3/rq4ilfjun81i/intro

As I see I need such rule toImage($ => $('meta[name="og:image"]').attr('content'))

Would you be so kind to add it?

Kikobeats commented 1 year ago

Hello,

The image is not being detected because the following markup:

<meta name="og:image" content="https://app.maze.co/report/blockBookmarks/intro.png">

That is present on the site is not following https://ogp.me/ spec; It should be:

<meta property="og:image" content="https://app.maze.co/report/blockBookmarks/intro.png">

It's better to don't support non-standard rules as part of the metascraper core packages.

In case you really need it, you can always build your own, you can see the details about how to do that at: https://github.com/microlinkhq/metascraper/blob/master/CONTRIBUTING.md

m-rolana commented 1 year ago

Thank you for enlightening me and really quick and detailed answer! Yeah, it is no way to skip previews for this app. I tried custom rule as you had suggested and it worked like a magic. Thank you!