Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
tw4l authored Nov 5, 2024
1 parent 5376aac commit a63077d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/crawler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,11 @@ self.__bx_behaviors.selectMainBehavior();
await textextract.extractAndStoreText("textFinal", true, true);
}

if (this.params.screenshot && this.screenshotWriter) {
if (
this.params.screenshot &&
this.screenshotWriter &&
this.params.screenshot.includes("fullPageAfterBehaviors")
) {
await page.evaluate(() => {
window.scrollTo(0, 0);
});
Expand All @@ -1033,9 +1037,7 @@ self.__bx_behaviors.selectMainBehavior();
url,
writer: this.screenshotWriter,
});
if (this.params.screenshot.includes("fullPageAfterBehaviors")) {
await screenshots.takeFullPageAfterBehaviours();
}
await screenshots.takeFullPageAfterBehaviours();
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/util/argParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ class ArgParser {

screenshot: {
describe:
"Screenshot options for crawler, can include: view, thumbnail, fullPage, fullPageAfterBehaviors",
"Screenshot options for crawler, can include: view, thumbnail, fullPage, fullPageAfterBehaviors",
type: "array",
default: [],
choices: Array.from(Object.keys(screenshotTypes)),
Expand Down

0 comments on commit a63077d

Please sign in to comment.