Minor fix

This commit is contained in:
JakubDrobnik 2018-11-20 18:00:25 +01:00
parent 8d8dce7ffa
commit ab3af886f5

View File

@ -1,6 +1,6 @@
const Apify = require('apify'); const Apify = require('apify');
const sleepPromised = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); const sleep = Apify.utils;
const logError = (msg, e) => { const logError = (msg, e) => {
console.log(`ERROR: ${msg}`); console.log(`ERROR: ${msg}`);
@ -105,7 +105,7 @@ module.exports = async (page, maxHeight, elementToScroll = 'body') => {
await scrollTo(page, elementToScroll, scrollInfo.scrollHeight); await scrollTo(page, elementToScroll, scrollInfo.scrollHeight);
} }
await sleepPromised(defaultScrollDelay); await sleep(defaultScrollDelay);
} }
// Scroll back up, otherwise the screenshot of the browser would only show the bottom of // Scroll back up, otherwise the screenshot of the browser would only show the bottom of
// the page // the page