Tried Page.onLoadFinished
and this function also.
But for some websites its not waiting till the page is fully loaded. Is there any other way i can achieve this?
function checkReadyState() {
setTimeout(function () {
var readyState = page.evaluate(function () {
return document.readyState;
});
enter code here
if ("complete" === readyState) {
//create screenshot
} else {
checkReadyState();
}
});
}
checkReadyState();
Please help.