From 111048aee4fdb79dbf0b8e26284f832dc2549392 Mon Sep 17 00:00:00 2001 From: JakubDrobnik Date: Wed, 21 Nov 2018 14:05:24 +0100 Subject: [PATCH] Fixed waiting --- src/main.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index 2d75d97..d6f8f66 100644 --- a/src/main.js +++ b/src/main.js @@ -140,11 +140,14 @@ Apify.main(async () => { maxRequestRetries: MAX_PAGE_RETRIES, retireInstanceAfterRequestCount: 10, handlePageTimeoutSecs: 600, + gotoFunction: async ({ request, page }) => { + await page._client.send('Emulation.clearDeviceMetricsOverride'); + await page.goto(request.url, { timeout: 60000 }) + }, handlePageFunction: async ({ request, page }) => { const { label } = request.userData; console.log(`Open ${request.url} with label: ${label}`); // Get data from review - await page._client.send('Emulation.clearDeviceMetricsOverride'); await injectJQuery(page); await page.waitForSelector('h1.section-hero-header-title', { timeout: DEFAULT_TIMEOUT }); const placeDetail = await page.evaluate(() => {