i'm new to cheerio and want to scrape all team names in a particular table and return the data as json for instance like
{
name: "Manchester City"
}
so far i've created below which is suppose to be an api returning the data, however i cant seem to access any particular elements? i keep getting following response TypeError: Converting circular structure to JSON
Code
app.get('/api/standings', function(req, res, next){
var base = "http://www.skysports.com/football/competitions/premier-league/tables";
var age = 2015;
request.get(`${base}`, function(err, response, body) {
var $ = cheerio.load(body);
//get standings
var classes = $('standing-table__table tbody tr').each(function() {
var d = $(this);
var td = d.children('td.standing-table__cell standing-table__cell--name');
return td.eq(0).text();
});
res.json(classes);
});
});