maxun-core 0.0.17 → 0.0.18
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/build/interpret.d.ts +1 -0
- package/build/interpret.js +11 -7
- package/package.json +1 -1
package/build/interpret.d.ts
CHANGED
package/build/interpret.js
CHANGED
|
@@ -385,7 +385,7 @@ class Interpreter extends events_1.EventEmitter {
|
|
|
385
385
|
yield this.options.serializableCallback([mergedResult]);
|
|
386
386
|
}),
|
|
387
387
|
scrapeList: (config) => __awaiter(this, void 0, void 0, function* () {
|
|
388
|
-
var _f;
|
|
388
|
+
var _f, _g;
|
|
389
389
|
if ((_f = this.options.debugChannel) === null || _f === void 0 ? void 0 : _f.setActionType) {
|
|
390
390
|
this.options.debugChannel.setActionType('scrapeList');
|
|
391
391
|
}
|
|
@@ -394,6 +394,9 @@ class Interpreter extends events_1.EventEmitter {
|
|
|
394
394
|
return;
|
|
395
395
|
}
|
|
396
396
|
yield this.ensureScriptsLoaded(page);
|
|
397
|
+
if ((_g = this.options.debugChannel) === null || _g === void 0 ? void 0 : _g.incrementScrapeListIndex) {
|
|
398
|
+
this.options.debugChannel.incrementScrapeListIndex();
|
|
399
|
+
}
|
|
397
400
|
if (!config.pagination) {
|
|
398
401
|
const scrapeResults = yield page.evaluate((cfg) => window.scrapeList(cfg), config);
|
|
399
402
|
yield this.options.serializableCallback(scrapeResults);
|
|
@@ -404,8 +407,8 @@ class Interpreter extends events_1.EventEmitter {
|
|
|
404
407
|
}
|
|
405
408
|
}),
|
|
406
409
|
scrapeListAuto: (config) => __awaiter(this, void 0, void 0, function* () {
|
|
407
|
-
var
|
|
408
|
-
if ((
|
|
410
|
+
var _h;
|
|
411
|
+
if ((_h = this.options.debugChannel) === null || _h === void 0 ? void 0 : _h.setActionType) {
|
|
409
412
|
this.options.debugChannel.setActionType('scrapeListAuto');
|
|
410
413
|
}
|
|
411
414
|
yield this.ensureScriptsLoaded(page);
|
|
@@ -415,8 +418,8 @@ class Interpreter extends events_1.EventEmitter {
|
|
|
415
418
|
yield this.options.serializableCallback(scrapeResults);
|
|
416
419
|
}),
|
|
417
420
|
scroll: (pages) => __awaiter(this, void 0, void 0, function* () {
|
|
418
|
-
var
|
|
419
|
-
if ((
|
|
421
|
+
var _j;
|
|
422
|
+
if ((_j = this.options.debugChannel) === null || _j === void 0 ? void 0 : _j.setActionType) {
|
|
420
423
|
this.options.debugChannel.setActionType('scroll');
|
|
421
424
|
}
|
|
422
425
|
yield page.evaluate((pagesInternal) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -427,8 +430,8 @@ class Interpreter extends events_1.EventEmitter {
|
|
|
427
430
|
}), pages !== null && pages !== void 0 ? pages : 1);
|
|
428
431
|
}),
|
|
429
432
|
script: (code) => __awaiter(this, void 0, void 0, function* () {
|
|
430
|
-
var
|
|
431
|
-
if ((
|
|
433
|
+
var _k;
|
|
434
|
+
if ((_k = this.options.debugChannel) === null || _k === void 0 ? void 0 : _k.setActionType) {
|
|
432
435
|
this.options.debugChannel.setActionType('script');
|
|
433
436
|
}
|
|
434
437
|
const AsyncFunction = Object.getPrototypeOf(() => __awaiter(this, void 0, void 0, function* () { })).constructor;
|
|
@@ -530,6 +533,7 @@ class Interpreter extends events_1.EventEmitter {
|
|
|
530
533
|
});
|
|
531
534
|
allResults = allResults.concat(newResults);
|
|
532
535
|
debugLog("Results collected:", allResults.length);
|
|
536
|
+
yield this.options.serializableCallback(allResults);
|
|
533
537
|
});
|
|
534
538
|
const checkLimit = () => {
|
|
535
539
|
if (config.limit && allResults.length >= config.limit) {
|