universal-pdp-scrapper
Version:
A universal pdp scrapper using cheerio & ChatGPT
18 lines (17 loc) • 679 B
TypeScript
import type { ProductMetadata, ScrapperOutput } from './types/scrapperOutput';
export declare const getRawData: (url: string, html: string) => Promise<ScrapperOutput | null>;
export declare const getProductMetadata: (sourceUrl: string, html: string) => ProductMetadata;
export declare class UniversalPDPScrapper {
private readonly openAiClient;
constructor(config?: ({
serpApiKey?: string;
} | {
googleApiKey?: string;
googleCseId?: string;
}) & {
openaiApiKey?: string;
openaiOrgId?: string;
openaiModelId?: string;
});
scrape: (url: string, timeoutInSeconds?: number) => Promise<ScrapperOutput | null>;
}