@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.cjs
CHANGED
|
@@ -362,10 +362,10 @@ var ActorInfo = {
|
|
|
362
362
|
xurl: []
|
|
363
363
|
}
|
|
364
364
|
}),
|
|
365
|
-
//
|
|
366
|
-
|
|
367
|
-
key: "
|
|
368
|
-
name: "\u901A\u7528\
|
|
365
|
+
// 通用文章抓取 Actor:入口 URL 来自 query,因此这里只声明统一的 Actor 元信息。
|
|
366
|
+
article: createActorInfo({
|
|
367
|
+
key: "article",
|
|
368
|
+
name: "\u901A\u7528\u6587\u7AE0",
|
|
369
369
|
domain: "",
|
|
370
370
|
path: "/",
|
|
371
371
|
share: {
|
|
@@ -2424,6 +2424,7 @@ async function createApifyKit() {
|
|
|
2424
2424
|
}
|
|
2425
2425
|
const { Actor: Actor2 } = apify;
|
|
2426
2426
|
const actorInput = await Actor2.getInput() || {};
|
|
2427
|
+
const isDebugMode = Boolean(actorInput.debugMode || actorInput.debug_mode);
|
|
2427
2428
|
let lastPage = null;
|
|
2428
2429
|
const getRuntimeContext = () => resolveRuntimeContext(actorInput);
|
|
2429
2430
|
return {
|
|
@@ -2500,6 +2501,14 @@ async function createApifyKit() {
|
|
|
2500
2501
|
const finalError = lastResult.error;
|
|
2501
2502
|
if (failActor) {
|
|
2502
2503
|
let base64 = "\u622A\u56FE\u5931\u8D25";
|
|
2504
|
+
let html;
|
|
2505
|
+
if (isDebugMode && page) {
|
|
2506
|
+
try {
|
|
2507
|
+
html = await page.content();
|
|
2508
|
+
} catch (htmlErr) {
|
|
2509
|
+
logger3.warn(`HTML \u91C7\u96C6\u5931\u8D25: ${htmlErr.message}`);
|
|
2510
|
+
}
|
|
2511
|
+
}
|
|
2503
2512
|
try {
|
|
2504
2513
|
if (page) {
|
|
2505
2514
|
const buffer = await capturePageScreenshot(page, {
|
|
@@ -2517,7 +2526,8 @@ async function createApifyKit() {
|
|
|
2517
2526
|
{
|
|
2518
2527
|
step,
|
|
2519
2528
|
base64,
|
|
2520
|
-
retryAttempts: retryTimes
|
|
2529
|
+
retryAttempts: retryTimes,
|
|
2530
|
+
...html ? { html } : {}
|
|
2521
2531
|
},
|
|
2522
2532
|
{
|
|
2523
2533
|
page,
|