Since opengraph only provide those informations
array(2) { ["engagement"]=> array(4) {
["reaction_count"]=> int(1)
["comment_count"]=> int(0)
["share_count"]=> int(1)
["comment_plugin_count"]=> int(0)
}
I'm trying to have the like count of a url.
So I found this information on the button like, which have this number.
<span class="_49vh _2pi7">J’aime</span>
<span class="_5n6h _2pih" id="u_0_2_/+">2</span>
I found that the span with the count has an Id but it change for each page. But the class used is the same for each pages ._5n6h ._2pih
I'm trying to have the count of this span.
My script was very simple
<script type="text/javascript" async defer>
$(document).ready(function () {
var elmId = $('._5n6h._2pih').html();
console.log(elmId);
})
</script>
I can not have them
Uncaught TypeError: $(...).html is not a function
I don't know what am I doing wrong.