So i have code scraping like this. but this code eror when me save to json file
massage eror = TypeError: Converting circular structure to JSON starting at object with constructor 'Node' property 'children' -> object with constructor 'Array' index 0 -> object with constructor 'Node' property 'parent' closes the circle at JSON.stringify ()
const axios = require('axios');
const cheerio = require('cheerio');
var fs = require('fs');
const url = 'https://icons8.com/line-awesome';
axios(url)
.then(response => {
const html = response.data;
const $ = cheerio.load(html)
const listIcons = $('.icons-group');
const list = [];
listIcons.each(function () {
const title = $(this).find('.icons-title').text();
const icons = [];
const panjang = $(this).find('.name');
for (let i = 0; i < panjang.length; i++) {
icons.push($(panjang[i]).text());
}
// console.log(panjang.length);
// console.log(panjang[0]);
list.push({
title,
icons,
});
console.log(list);
});
fs.writeFile('nama.json', JSON.stringify(listIcons, null, 4));
})
.catch(console.error);