Was trying to read the webpage using javascript & willing to run this from UNIX terminal using below, shell> node test_code.js.
test_code.js
const request = require('request');
request('http://mylocalurl.html', function (error, response, body) {
console.error('error:', error); // Print the error if one occurred
console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received
console.log('body:', body); // Print the HTML for the Google homepage.
});
The above code does not wait for the web page to completely load(i.e, full load) & it gives the interim data which is inadequate.
Ask is to, check if we can make the request() function to wait for some time for the webpage to load until it pumps all data & later show all data within the response.
Any help on this would be much appreciated.
Thank you.