const cheerio = require('cheerio')
const $ = cheerio.load('<h2 class="title">Hello world</h2>')
$('h2.title').text('Hello there!')
$('h2').addClass('welcome')
$.html()
//=> <h2 class="title welcome">Hello there!</h2>
https://github.com/cheeriojs/cheerio
本站文章如无特殊说明,均为本站原创,如若转载,请注明出处:爬虫–cheerio - Python技术站