Nodejs Cheerio DOM 解析器:有没有办法 select 特定范围的元素?

Nodejs Cheerio DOM parser: Is there a way to select a specific range of elements?

我想 select 特定范围的元素,通过 Cheerio select 或者。例如,类似于:

$('.someClass [0-3]')

在求助于使用 JS 对其进行切片之前,我想探索使用 select 或其自身进行切片的选项(我什至不确定 Jquery 是否可行) .

可以吗?

Cheerio 使用 CSS 选择器,例如 JQuery,所以像这样的东西应该可以工作。

$('.someclass:nth-child(-n+3)')