August 2018
Beginner to intermediate
214 pages
6h 39m
English
In your project folder, run the following command:
npm i --save cheerio
The basics on cheerio are you parse text by calling:
const cheerio = require('cheerio')const $ = cheerio.load(htmlText)
Then, query using the $ variable like you would with JQuery (see Further reading if you've never used JQuery for a link to a great primer on selecting elements):
let divWithIDHello = $('#hello')let helloDivText = divWithIDHello.text()
Read now
Unlock full access