@skrillex1224/playwright-toolkit 3.0.32 → 3.0.34
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/browser.js +4 -4
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +15 -5
- package/dist/index.cjs.map +2 -2
- package/dist/index.js +15 -5
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -335,10 +335,10 @@ var ActorInfo = {
|
|
|
335
335
|
xurl: []
|
|
336
336
|
}
|
|
337
337
|
}),
|
|
338
|
-
//
|
|
339
|
-
|
|
340
|
-
key: "
|
|
341
|
-
name: "\u901A\u7528\
|
|
338
|
+
// 通用文章抓取 Actor:入口 URL 来自 query,因此这里只声明统一的 Actor 元信息。
|
|
339
|
+
article: createActorInfo({
|
|
340
|
+
key: "article",
|
|
341
|
+
name: "\u901A\u7528\u6587\u7AE0",
|
|
342
342
|
domain: "",
|
|
343
343
|
path: "/",
|
|
344
344
|
share: {
|
|
@@ -2396,6 +2396,7 @@ async function createApifyKit() {
|
|
|
2396
2396
|
}
|
|
2397
2397
|
const { Actor: Actor2 } = apify;
|
|
2398
2398
|
const actorInput = await Actor2.getInput() || {};
|
|
2399
|
+
const isDebugMode = Boolean(actorInput.debugMode || actorInput.debug_mode);
|
|
2399
2400
|
let lastPage = null;
|
|
2400
2401
|
const getRuntimeContext = () => resolveRuntimeContext(actorInput);
|
|
2401
2402
|
return {
|
|
@@ -2472,6 +2473,14 @@ async function createApifyKit() {
|
|
|
2472
2473
|
const finalError = lastResult.error;
|
|
2473
2474
|
if (failActor) {
|
|
2474
2475
|
let base64 = "\u622A\u56FE\u5931\u8D25";
|
|
2476
|
+
let html;
|
|
2477
|
+
if (isDebugMode && page) {
|
|
2478
|
+
try {
|
|
2479
|
+
html = await page.content();
|
|
2480
|
+
} catch (htmlErr) {
|
|
2481
|
+
logger3.warn(`HTML \u91C7\u96C6\u5931\u8D25: ${htmlErr.message}`);
|
|
2482
|
+
}
|
|
2483
|
+
}
|
|
2475
2484
|
try {
|
|
2476
2485
|
if (page) {
|
|
2477
2486
|
const buffer = await capturePageScreenshot(page, {
|
|
@@ -2489,7 +2498,8 @@ async function createApifyKit() {
|
|
|
2489
2498
|
{
|
|
2490
2499
|
step,
|
|
2491
2500
|
base64,
|
|
2492
|
-
retryAttempts: retryTimes
|
|
2501
|
+
retryAttempts: retryTimes,
|
|
2502
|
+
...html ? { html } : {}
|
|
2493
2503
|
},
|
|
2494
2504
|
{
|
|
2495
2505
|
page,
|