utiller 1.0.258 → 1.0.259
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/lib/utiller/index.js
CHANGED
|
@@ -2899,7 +2899,9 @@ var Utiller = /*#__PURE__*/function () {
|
|
|
2899
2899
|
return match ? Number(match[0]) : null;
|
|
2900
2900
|
}
|
|
2901
2901
|
|
|
2902
|
-
/** puppeteer 的 fetch function
|
|
2902
|
+
/** puppeteer 的 fetch function
|
|
2903
|
+
* 使用這個function的朋友必須安裝puppeteer:v23.6
|
|
2904
|
+
* */
|
|
2903
2905
|
}, {
|
|
2904
2906
|
key: "fetchElementAttributes",
|
|
2905
2907
|
value: (function () {
|
|
@@ -2919,7 +2921,7 @@ var Utiller = /*#__PURE__*/function () {
|
|
|
2919
2921
|
for (_len24 = _args8.length, attributes = new Array(_len24 > 2 ? _len24 - 2 : 0), _key26 = 2; _key26 < _len24; _key26++) {
|
|
2920
2922
|
attributes[_key26 - 2] = _args8[_key26];
|
|
2921
2923
|
}
|
|
2922
|
-
if (
|
|
2924
|
+
if (this.isUndefinedNullEmpty(element)) {
|
|
2923
2925
|
_context8.next = 10;
|
|
2924
2926
|
break;
|
|
2925
2927
|
}
|
|
@@ -2928,17 +2930,17 @@ var Utiller = /*#__PURE__*/function () {
|
|
|
2928
2930
|
if (attributes.length === 1) return el[attributes.shift()];
|
|
2929
2931
|
return _objectSpread({}, attributes.map(function (attr) {
|
|
2930
2932
|
return el[attr];
|
|
2931
|
-
}));
|
|
2933
|
+
})); //或者 el.getAttribute('src') 更精確!
|
|
2932
2934
|
}, attributes);
|
|
2933
2935
|
case 7:
|
|
2934
2936
|
return _context8.abrupt("return", _context8.sent);
|
|
2935
2937
|
case 10:
|
|
2936
|
-
|
|
2938
|
+
this.appendError("1581532 ".concat(stringOfTrait, " fetch ").concat(JSON.stringify(attributes), " fail, element is not found"));
|
|
2937
2939
|
case 11:
|
|
2938
2940
|
case "end":
|
|
2939
2941
|
return _context8.stop();
|
|
2940
2942
|
}
|
|
2941
|
-
}, _callee7);
|
|
2943
|
+
}, _callee7, this);
|
|
2942
2944
|
}));
|
|
2943
2945
|
function fetchElementAttributes(_x4, _x5) {
|
|
2944
2946
|
return _fetchElementAttributes.apply(this, arguments);
|
package/package.json
CHANGED