When using cheerio to parse HTML, what if you cycle out the selected elements?

although the cheerio syntax is similar to jQuery, when jQuery selects an element:

$(".class")

returns a jQuery object, and we can get each .class element through an array

$(".class")[1].find("selector").xxxx

however, cheerio cannot use the above method and will prompt find is not a function.

in Python, using BeautifulSoup also returns an array of HTML objects, which makes it easy to loop out all the elements and wonder if node has any related methods.


$('.class').eq(index)
Menu