mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-11 11:29:02 +08:00
feat(actions): add scroll
This commit is contained in:
parent
3dd912ec91
commit
d663bbf0ca
@ -78,6 +78,10 @@ export const actionsSchema = z.array(z.union([
|
|||||||
type: z.literal("pressKey"),
|
type: z.literal("pressKey"),
|
||||||
key: z.string(),
|
key: z.string(),
|
||||||
}),
|
}),
|
||||||
|
z.object({
|
||||||
|
type: z.literal("scroll"),
|
||||||
|
direction: z.enum(["up", "down"]),
|
||||||
|
}),
|
||||||
]));
|
]));
|
||||||
|
|
||||||
export const scrapeOptions = z.object({
|
export const scrapeOptions = z.object({
|
||||||
|
@ -25,6 +25,9 @@ export type Action = {
|
|||||||
} | {
|
} | {
|
||||||
type: "pressKey",
|
type: "pressKey",
|
||||||
key: string,
|
key: string,
|
||||||
|
} | {
|
||||||
|
type: "scroll",
|
||||||
|
direction: "up" | "down"
|
||||||
};
|
};
|
||||||
|
|
||||||
export type PageOptions = {
|
export type PageOptions = {
|
||||||
|
@ -99,7 +99,10 @@ export type Action = {
|
|||||||
} | {
|
} | {
|
||||||
type: "pressKey",
|
type: "pressKey",
|
||||||
key: string,
|
key: string,
|
||||||
};;
|
} | {
|
||||||
|
type: "scroll",
|
||||||
|
direction: "up" | "down",
|
||||||
|
};
|
||||||
|
|
||||||
export interface ScrapeParams<LLMSchema extends zt.ZodSchema = any, ActionsSchema extends (Action[] | undefined) = undefined> extends CrawlScrapeOptions {
|
export interface ScrapeParams<LLMSchema extends zt.ZodSchema = any, ActionsSchema extends (Action[] | undefined) = undefined> extends CrawlScrapeOptions {
|
||||||
extract?: {
|
extract?: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user