diff --git a/playwright/cdp.js b/playwright/cdp.js index 72267d3..d334ce7 100644 --- a/playwright/cdp.js +++ b/playwright/cdp.js @@ -49,14 +49,14 @@ for (var run = 0; run { const price = document.querySelector('#product-price'); return price.textContent.length > 0; - }); + }, {}, {timeout: 100}); // timeout 100ms // ensure the reviews are loaded. await page.waitForFunction(() => { const reviews = document.querySelectorAll('#product-reviews > div'); return reviews.length > 0; - }); + }, {}, {timeout: 100}); // timeout 100ms let res = {}; diff --git a/puppeteer/cdp.js b/puppeteer/cdp.js index a0b57f4..e93cd65 100644 --- a/puppeteer/cdp.js +++ b/puppeteer/cdp.js @@ -54,14 +54,14 @@ let metrics = []; await page.waitForFunction(() => { const price = document.querySelector('#product-price'); return price.textContent.length > 0; - }); + }, {timeout: 100}); // timeout 100ms // ensure the reviews are loaded. await page.waitForFunction(() => { const reviews = document.querySelectorAll('#product-reviews > div'); return reviews.length > 0; - }); + }, {timeout: 100}); // timeout 100ms let res = {};