Skip to content

Instantly share code, notes, and snippets.

@Maxim-Kolmogorov
Created November 29, 2022 13:29
Show Gist options
  • Save Maxim-Kolmogorov/23ad3981bdd0a93b91481c2c5fe8a7e7 to your computer and use it in GitHub Desktop.
Save Maxim-Kolmogorov/23ad3981bdd0a93b91481c2c5fe8a7e7 to your computer and use it in GitHub Desktop.
Parser example (for article).
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