获取cheerio对象的全文

问题描述

我想在cheerio中加载HTML代码段,然后删除一些元素,然后简单地将操作后的代码段写入文件中。

尽管听起来很琐碎,但是cheerio文档(https://www.npmjs.com/package/cheerio)并没有说明如何在不选择某些特定元素的情况下简单地从cheerio对象($)获取全文。

这是我的代码

Promise.all(this.hostName.slice(0,this.Id.length).map(hostName => 
      this.serviceA.Status(hostName)
      .then(hostId => this.serviceB.createDbEntry(hostId).then(() => hostId))
      .then(hostId => this.serviceC.runEntry(hostId))
      )).then(() => this.dialog.close())

有关如何执行此操作的任何想法?

解决方法

可能只是身体:

TargetServerVersion

您可能需要先删除脚本/样式元素