@intuned/browser-dev 2.2.3-unify-sdks.21 → 2.2.3-unify-sdks.23
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/dist/ai/export.d.js +3 -1
- package/dist/ai/export.d.ts +76 -53
- package/dist/ai/extractStructuredDataUsingAi.js +12 -8
- package/dist/ai/index.d.ts +76 -53
- package/dist/ai/isPageLoaded.js +5 -0
- package/dist/ai/tests/testCheckAllTypesAreStrings.spec.js +2 -4
- package/dist/ai/validators.js +8 -6
- package/dist/helpers/downloadFile.js +2 -2
- package/dist/helpers/export.d.ts +135 -132
- package/dist/helpers/gotoUrl.js +3 -4
- package/dist/helpers/index.d.ts +135 -132
- package/dist/helpers/sanitizeHtml.js +5 -4
- package/dist/helpers/scrollToLoadContent.js +1 -1
- package/dist/helpers/tests/testExtractMarkdown.spec.js +4 -6
- package/dist/playwright/export.d.js +5 -0
- package/dist/playwright/export.d.ts +220 -0
- package/dist/playwright/index.d.ts +220 -0
- package/dist/playwright/index.js +18 -0
- package/dist/playwright/staticExtractors/extractHelpers.js +170 -0
- package/dist/playwright/staticExtractors/getArrayUsingArrayExtractor.js +84 -0
- package/dist/playwright/staticExtractors/getObjectUsingObjectExtractor.js +45 -0
- package/dist/playwright/staticExtractors/index.js +37 -0
- package/dist/playwright/staticExtractors/types.js +26 -0
- package/package.json +8 -2
package/dist/helpers/gotoUrl.js
CHANGED
|
@@ -8,6 +8,7 @@ var _promises = require("timers/promises");
|
|
|
8
8
|
var _asyncRetry = _interopRequireDefault(require("async-retry"));
|
|
9
9
|
var _playwrightCore = require("playwright-core");
|
|
10
10
|
var _isPageLoaded = require("../ai/isPageLoaded");
|
|
11
|
+
var _Logger = require("../common/Logger");
|
|
11
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
13
|
const DEFAULT_PLAYWRIGHT_TIMEOUT = 30000;
|
|
13
14
|
const TIMEOUT_PADDING = 3000;
|
|
@@ -45,7 +46,7 @@ const goToUrl = async input => {
|
|
|
45
46
|
timeout: timeoutInMs
|
|
46
47
|
});
|
|
47
48
|
} catch (error) {
|
|
48
|
-
|
|
49
|
+
_Logger.logger.error(`Failed to wait for networkidle on URL: ${url}. Error: ${error}`);
|
|
49
50
|
}
|
|
50
51
|
}, {
|
|
51
52
|
retries,
|
|
@@ -63,18 +64,16 @@ const goToUrl = async input => {
|
|
|
63
64
|
}
|
|
64
65
|
for (let i = 0; i < 4; i++) {
|
|
65
66
|
try {
|
|
66
|
-
console.log("Checking if page is loaded", url);
|
|
67
67
|
const isLoaded = await (0, _isPageLoaded.isPageLoaded)(page, {
|
|
68
68
|
timeoutInMs,
|
|
69
69
|
model,
|
|
70
70
|
apiKey: apiKey ? apiKey : undefined
|
|
71
71
|
});
|
|
72
|
-
console.log("Page is loaded", url, isLoaded);
|
|
73
72
|
if (isLoaded["status"] === true) {
|
|
74
73
|
return;
|
|
75
74
|
}
|
|
76
75
|
} catch (error) {
|
|
77
|
-
|
|
76
|
+
_Logger.logger.debug(`Failed to check if page is loaded: ${url}. Error: ${error}`);
|
|
78
77
|
}
|
|
79
78
|
if (i === 2) {
|
|
80
79
|
throw new _playwrightCore.errors.TimeoutError("Page.goto did not load the page within the expected time.\n" + `(URL: ${url}, timeout: ${timeoutInMs}ms)`);
|