I have a problem when using cheerio to retrieve news headline data. the case is that when I took the headline, the data obtained was data from 4 days ago. How can I get the latest data from the website? I’ve tried clearing cache and cookies, but it’s not working
this is my code
'use strict';
require('colors');
const request = require('request');
const cheerio = require('cheerio');
let url = 'https://prokalteng.jawapos.com/index-berita/';
request(url, function (err, res, body) {
if (err && res.statusCode !== 200) throw err;
let $ = cheerio.load(body);
$('div.td_block_wrap.td_flex_block_1.tdi_74.td_with_ajax_pagination.td-pb-border-top.td_block_template_1.td_flex_block div[id=tdi_74] div div div.td-module-meta-info h3.entry-title.td-module-title').each((i, value) => {
$(value).find('a').each((j, data) => {
return process.stdout.write($(data).text() + 't');
});
process.stdout.write('n');
});
});
this is the result and that data from 4 days ago
the result and data from 4 days ago
this is latest data
latest data