the small crawler written by node reported an error when it was written to parse the crawled data with cheerio, saying that it was a problem of circular invocation. Paste code:
$("-sharplive-list-contentbox>li").each((i, ele) => {
let _this = $(ele);
rooms.push({
title: _this.find(".play-list-link").attr("title"),
author: _this.find(".dy-name").text(),
room_num: _this.find(".play-list-link").attr("href").replace(/\//g, ""),
room_label: _this.find(".impress-tag-item").map((i, ele) => {
return $(this).text()
})
});
});
the outermost each above is each li,. I want to put a few crawled text tags in the room_label, and then I want to use map to traverse an array, only to report an error. It is said that it is a circular call. If the map is removed, it can work normally. I would like to ask why the traversal method can not be used in such nesting?
error figure: