feat(scrape): scroll down/up with actions if fullpagescreenshot

revert this if unneeded
This commit is contained in:
Gergő Móricz 2024-09-20 21:42:09 +02:00
parent d663bbf0ca
commit 815bfc8f07

View File

@ -210,10 +210,26 @@ export async function scrapSingleUrl(
type: "wait" as const,
milliseconds: pageOptions.waitFor,
}] : []),
...(pageOptions.fullPageScreenshot ? [
{
type: "scroll" as const,
direction: "down" as const,
},
{
type: "wait" as const,
milliseconds: 300,
},
] : []),
...((pageOptions.screenshot || pageOptions.fullPageScreenshot) ? [{
type: "screenshot" as const,
fullPage: !!pageOptions.fullPageScreenshot,
}] : []),
...(pageOptions.fullPageScreenshot ? [
{
type: "scroll" as const,
direction: "up" as const,
}
] : []),
...(pageOptions.actions ?? []),
],
}) : ({