Let's say I have the following:
假设我有以下内容:
$ = cheerio.load('<html><body><ul><li>One</li><li>Two</li></body></html>');
var t = $('html').find('*').contents().filter(function() {
return this.type === 'text';
}).text();
$Let's say I have the following:
假设我有以下内容:
$ = cheerio.load('<html><body><ul><li>One</li><li>Two</li></body></html>');
var t = $('html').find('*').contents().filter(function() {
return this.type === 'text';
}).text();
$