[包计划] cheerio
cheerio
专为后端设计的 jQuery 核心模块,可以在 Node 中使用 jQuery 语法。
const cheerio = require('cheerio')
const $ = cheerio.load('<h2 class="title">Hello world</h2>')
$('h2.title').text('Hello there!')
$('h2').addClass('welcome')
$.html()
//=> <html><head></head><body><h2 class="title welcome">Hello there!</h2></body></html>