universal-pdp-scrapper
Version:
A universal pdp scrapper using cheerio & ChatGPT
40 lines (39 loc) • 881 B
TypeScript
import type { ScrapperOutput } from '../types/scrapperOutput';
export interface ProductJSON {
'@context': string;
'@type': string;
name: string;
description: string;
productID: string;
image: string;
sku: string;
brand: Brand;
offers: Offers;
aggregateRating: AggregateRating;
}
export interface AggregateRating {
'@type': string;
ratingValue: number;
reviewCount: number;
worstRating: number;
bestRating: number;
}
export interface Brand {
'@type': string;
name: string;
}
export interface Offers {
'@type': string;
'@id': string;
priceCurrency: string;
price: number;
sku: string;
availability: string;
seller: Brand;
url: string;
}
export declare class Builddotcom {
readonly url: string;
constructor(url: string);
extract(html?: string): Promise<ScrapperOutput>;
}