universal-pdp-scrapper
Version:
A universal pdp scrapper using cheerio & ChatGPT
72 lines (71 loc) • 1.64 kB
TypeScript
import type { ScrapperOutput } from '../types/scrapperOutput';
export interface HomedepotProductStructureData {
'@context': string;
'@type': string;
name: string;
image: string[];
description: string;
productID: string;
sku: string;
gtin13: string;
depth: string;
height: string;
width: string;
color: string;
weight: string;
brand: Brand;
aggregateRating: AggregateRating;
offers: Offers;
review: Review[];
}
export interface AggregateRating {
'@type': string;
ratingValue: string;
reviewCount: number;
}
export interface Brand {
'@type': BrandType;
name: string;
}
export declare enum BrandType {
Brand = "Brand",
Person = "Person"
}
export interface Offers {
'@type': string;
url: string;
priceCurrency: string;
price: number;
priceValidUntil: string;
availability: string;
hasMerchantReturnPolicy: HasMerchantReturnPolicy;
}
export interface HasMerchantReturnPolicy {
'@type': string;
applicableCountry: string;
returnPolicyCategory: string;
merchantReturnDays: number;
}
export interface Review {
'@type': ReviewType;
reviewRating: ReviewRating;
author: Brand;
headline: string;
reviewBody: string;
}
export declare enum ReviewType {
Review = "Review"
}
export interface ReviewRating {
'@type': ReviewRatingType;
ratingValue: number;
bestRating: string;
}
export declare enum ReviewRatingType {
Rating = "Rating"
}
export declare class Homedepot {
readonly url: string;
constructor(url: string);
extract(html?: string): Promise<ScrapperOutput>;
}