1
Cheerio에서는 현재 노드의 텍스트 만 어떻게 구합니까?현재 노드의 텍스트 만 가져 오기
var cheerio = require('cheerio')
const htmlString = '<div>hello<span>world</span></div>'
$ = cheerio.load(htmlString, { ignoreWhitespace: true })
console.log($('div').text()) //helloworld
console.log($('span').text()) //world
어떻게 hello
을 얻을 수 있습니까?
는 참조 용으로 https://github.com/cheeriojs/cheerio/issues/146를 참조하십시오 – Kevin