I am trying to get guild names from the loaded items in a particular url, but the output results are far from the expected. What am I doing wrong?
Here is my code:
const request = require('request-promise');
const cheerio = require('cheerio');
const url = 'https://us.tamrieltradecentre.com/pc/Trade/SearchResult?SearchType=Sell&ItemID=11807&ItemNamePattern=Aetherial+Dust&PriceMax=450000';
const time_out = 3000; //300000 // 5 minutes
(async () => {
let data = [];
const response = await request({
uri: url,
headers: {
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
"accept-encoding": "gzip, deflate, br",
"accept-language": "pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7,ja;q=0.6",
},
gzip: true,
});
let $ = cheerio.load(response);
let guild = $('div[data-bind="text: GuildName"]')[0]
data.push({
lastGuild: guild,
});
console.log(data)
})();