Created
November 29, 2022 13:29
-
-
Save Maxim-Kolmogorov/23ad3981bdd0a93b91481c2c5fe8a7e7 to your computer and use it in GitHub Desktop.
Parser example (for article).
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 cheerio = require('cheerio') | |
async function start() { | |
const url = 'https://example.com/' | |
const result = await axios.get(url) | |
const $ = cheerio.load(result.data) | |
const title = $.html($('h1')) | |
console.log(title) | |
} | |
start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment