Skip to content

Instantly share code, notes, and snippets.

@gotocva
Created January 8, 2024 06:48
Show Gist options
  • Select an option

  • Save gotocva/1139b5d05f1c8465fccf7eaaf24af01f to your computer and use it in GitHub Desktop.

Select an option

Save gotocva/1139b5d05f1c8465fccf7eaaf24af01f to your computer and use it in GitHub Desktop.
const axios = require('axios');
const https = require('https');
const cheerio = require('cheerio');
const agent = new https.Agent({
rejectUnauthorized: false
});
const init = async () => {
const response = await axios.get(`https://sivabharathy.in`, { httpsAgent: agent });
$ = cheerio.load(response.data);
$title = $('head title').text();
$desc = $('meta[name="description"]').attr('content'),
$kwd = $('meta[name="keywords"]').attr('content'),
$ogTitle = $('meta[property="og:title"]').attr('content'),
$ogImage = $('meta[property="og:image"]').attr('content'),
$ogkeywords = $('meta[property="og:keywords"]').attr('content'),
$images = $('img');
console.log($title);
console.log('description', $desc);
}
init();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment