unprint 0.4.2 → 0.4.3

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unprint",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "Simplify common web scraping tasks while staying in control of the data.",
5
5
  "main": "src/app.js",
6
6
  "scripts": {
package/src/app.js CHANGED
@@ -513,8 +513,8 @@ function initAll(context, selector, options) {
513
513
  return handleError(new Error('Init context is not a DOM element, HTML or an array'), 'INVALID_CONTEXT');
514
514
  }
515
515
 
516
- return Array.from(context.querySelectorAll(options.select))
517
- .map((element) => init(element, selector, options));
516
+ return Array.from(context.querySelectorAll(selector))
517
+ .map((element) => init(element, null, options));
518
518
  }
519
519
 
520
520
  async function request(url, body, customOptions = {}, method = 'GET') {
package/tests/init.js CHANGED
@@ -12,8 +12,7 @@ const port = process.env.PORT || 3101;
12
12
  async function initTest() {
13
13
  unprint.options({ headers: { 'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36' } });
14
14
 
15
- const res = await unprint.get(`http://127.0.0.1:${port}/html`, { selectAll: 'body' });
16
-
15
+ const res = await unprint.get(`http://127.0.0.1:${port}/html`, { select: 'body' });
17
16
  // const jsonRes = await unprint.get(`http://127.0.0.1:${port}/json`);
18
17
  // const errorRes = await unprint.get(`http://127.0.0.1:${port}/error/404`);
19
18