contract-scraper
Version:
A customisable data scraper for the web based on JSON contracts
17 lines (16 loc) • 647 B
TypeScript
import { Provider } from './provider';
export default class HTMLProvider implements Provider {
private page;
private contract;
private attributes;
private $;
constructor(page: any, contract: any, attributes: any);
getItemOrParentElement(item: cheerio.Element, selector: string): cheerio.Cheerio;
getElementValue(element: cheerio.Cheerio, attribute: string, raw: boolean): string;
getElementDataAttributeKeyValue(element: cheerio.Cheerio, { name, key }: {
name: any;
key: any;
}): string | null;
mapElementToProperty(item: cheerio.Element, options: any): any;
getScrapedItems(): any[];
}