Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

cheerio library to parse the meta tags in url



request('https://example.com', function (error, response, html) {
  if (!error && response.statusCode == 200) {
    const $ = cheerio.load(html);
      console.log($("meta[property='og:title']").attr("content"));
      //or 
      console.log($("meta").get(1).attr("content")); // index of the meta tag
  }
});
Source by github.com #
 
PREVIOUS NEXT
Tagged: #cheerio #library #parse #meta #tags #url
ADD COMMENT
Topic
Name
2+3 =