Fixed waiting

This commit is contained in:
JakubDrobnik 2018-11-21 14:05:24 +01:00
parent 18ecfca288
commit 111048aee4

View File

@ -140,11 +140,14 @@ Apify.main(async () => {
maxRequestRetries: MAX_PAGE_RETRIES, maxRequestRetries: MAX_PAGE_RETRIES,
retireInstanceAfterRequestCount: 10, retireInstanceAfterRequestCount: 10,
handlePageTimeoutSecs: 600, handlePageTimeoutSecs: 600,
gotoFunction: async ({ request, page }) => {
await page._client.send('Emulation.clearDeviceMetricsOverride');
await page.goto(request.url, { timeout: 60000 })
},
handlePageFunction: async ({ request, page }) => { handlePageFunction: async ({ request, page }) => {
const { label } = request.userData; const { label } = request.userData;
console.log(`Open ${request.url} with label: ${label}`); console.log(`Open ${request.url} with label: ${label}`);
// Get data from review // Get data from review
await page._client.send('Emulation.clearDeviceMetricsOverride');
await injectJQuery(page); await injectJQuery(page);
await page.waitForSelector('h1.section-hero-header-title', { timeout: DEFAULT_TIMEOUT }); await page.waitForSelector('h1.section-hero-header-title', { timeout: DEFAULT_TIMEOUT });
const placeDetail = await page.evaluate(() => { const placeDetail = await page.evaluate(() => {