Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

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

Gergő Móricz815bfc8f07b3
diff --git a/apps/api/src/scraper/WebScraper/single_url.ts b/apps/api/src/scraper/WebScraper/single_url.ts
index 93fb0ce73..fc3a0efbc 100644
--- a/apps/api/src/scraper/WebScraper/single_url.ts
+++ b/apps/api/src/scraper/WebScraper/single_url.ts
@@ -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 ?? []),
],
}) : ({