@@ -93,6 +93,10 @@ export const actionsSchema = z.array(z.union([
|
|||||||
z.object({
|
z.object({
|
||||||
type: z.literal("scrape"),
|
type: z.literal("scrape"),
|
||||||
}),
|
}),
|
||||||
|
z.object({
|
||||||
|
type: z.literal("executeJavascript"),
|
||||||
|
script: z.string()
|
||||||
|
}),
|
||||||
]));
|
]));
|
||||||
|
|
||||||
export const scrapeOptions = z.object({
|
export const scrapeOptions = z.object({
|
||||||
|
|||||||
@@ -33,6 +33,9 @@ export type Action = {
|
|||||||
direction: "up" | "down"
|
direction: "up" | "down"
|
||||||
} | {
|
} | {
|
||||||
type: "scrape",
|
type: "scrape",
|
||||||
|
} | {
|
||||||
|
type: "executeJavascript",
|
||||||
|
script: string,
|
||||||
}
|
}
|
||||||
|
|
||||||
export type PageOptions = {
|
export type PageOptions = {
|
||||||
|
|||||||
@@ -109,6 +109,9 @@ export type Action = {
|
|||||||
direction: "up" | "down",
|
direction: "up" | "down",
|
||||||
} | {
|
} | {
|
||||||
type: "scrape",
|
type: "scrape",
|
||||||
|
} | {
|
||||||
|
type: "executeJavascript",
|
||||||
|
script: string,
|
||||||
};
|
};
|
||||||
|
|
||||||
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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user