maxun-core 0.0.31 → 0.0.32

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.
@@ -399,7 +399,13 @@ class Interpreter extends events_1.EventEmitter {
399
399
  return;
400
400
  }
401
401
  yield this.ensureScriptsLoaded(page);
402
- const scrapeResult = yield page.evaluate((schemaObj) => window.scrapeSchema(schemaObj), schema);
402
+ const normalizedSchema = Object.fromEntries(Object.entries(schema).map(([key, value]) => [
403
+ key,
404
+ typeof value === 'string'
405
+ ? { selector: value, tag: '', attribute: 'innerText', shadow: '' }
406
+ : value,
407
+ ]));
408
+ const scrapeResult = yield page.evaluate((schemaObj) => window.scrapeSchema(schemaObj), normalizedSchema);
403
409
  if (!this.cumulativeResults || !Array.isArray(this.cumulativeResults)) {
404
410
  this.cumulativeResults = [];
405
411
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maxun-core",
3
- "version": "0.0.31",
3
+ "version": "0.0.32",
4
4
  "description": "Core package for Maxun, responsible for data extraction",
5
5
  "main": "build/index.js",
6
6
  "typings": "build/index.d.ts",