I tried that but didn't work:
const https = require('https');
const fs = require("fs");
const options = {
hostname: 'dlive.tv',
port: 443,
path: '/IXCOSANXCI',
method: 'GET',
};
var html = ""
function func(){
fs.writeFileSync("./response.txt",html)
console.log("writed")
}
const req = https.request(options, res => {
console.log(`statusCode: ${res.statusCode}`);
res.on('data', d => {
html += d
});
setTimeout(func, 5 * 1000)
});
req.on('error', error => {
console.error(error);
});
req.end();
normally if you try this, the messages in the dlive chat will come unloaded:
const axios = require("axios");
const fs = require("fs");
(async () => {
const response = await axios.get(`https://dlive.tv/IXCOSANXCI`);
fs.writeFileSync("./response.txt",response.data)
})();
shortly Is there a way to get the entire site? i.e. response after 5 seconds or more
I use node.js v12.20.10