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

相关文章:

  • 2021-11-21
  • 2021-11-08
  • 2022-12-23
  • 2022-12-23
  • 2021-04-02
  • 2021-08-28
  • 2021-12-15
猜你喜欢
  • 2022-02-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案