Cheerio: Make cheerio objects Iterable

Created on 11 Apr 2020  路  3Comments  路  Source: cheeriojs/cheerio

Cheerio objects should be Iterable, so that we can use them in normal loops:

for(el of $('div')) {
  ...
}

Most helpful comment

Actually, the code to make objects iterable is already in the repo. However, there was no new release since then ...

All 3 comments

Have you tried using get()聽method? It returns an Array

Actually, the code to make objects iterable is already in the repo. However, there was no new release since then ...

...so in the meanwhile you can use get(). Just kididng 馃槄 You can use it even if it has not been released yet. Just reference the repo and the commit/branch in your package.json 馃槈

Was this page helpful?
0 / 5 - 0 ratings

Related issues

robogeek picture robogeek  路  4Comments

collegepinger picture collegepinger  路  3Comments

becush picture becush  路  3Comments

unicrus picture unicrus  路  4Comments

M3kH picture M3kH  路  4Comments