@opentermsarchive/engine 5.0.6 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -21,7 +21,7 @@ export default async function fetch(url, cssSelectors, config) {
|
|
|
21
21
|
await page.setDefaultNavigationTimeout(config.navigationTimeout);
|
|
22
22
|
await page.setExtraHTTPHeaders({ 'Accept-Language': config.language });
|
|
23
23
|
|
|
24
|
-
response = await page.goto(url, { waitUntil: '
|
|
24
|
+
response = await page.goto(url, { waitUntil: 'load' }); // Using `load` instead of `networkidle0` as it's more reliable and faster. The 'load' event fires when the page and all its resources (stylesheets, scripts, images) have finished loading. `networkidle0` can be problematic as it waits for 500ms of network inactivity, which may never occur on dynamic pages and then triggers a navigation timeout.
|
|
25
25
|
|
|
26
26
|
if (!response) {
|
|
27
27
|
throw new Error(`Response is empty when trying to fetch '${url}'`);
|