Slide 8
Slide 8 text
コードを貼り付ける
npm i open-graph-scraper
使い方の例
const ogs = require("open-graph-scraper");
const options = { url: "http://ogp.me/" };
const data = await ogs(options);
const { error, html, result, response } = data;
console.log("error:", error); // This returns true or false. True if there was an error. The error itself is inside the result
console.log("html:", html); // This contains the HTML of page
console.log("result:", result); // This contains all of the Open Graph results
console.log("response:", response); // This contains response from the Fetch API
8