Created
January 8, 2024 06:48
-
-
Save gotocva/1139b5d05f1c8465fccf7eaaf24af01f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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