html-tables-to-json
Version:
Parser for HTML to JSON
33 lines • 1.06 kB
TypeScript
/**
* Parses HTML into a DOM tree using Cheerio.
*/
declare class CheerioTableParser {
private $;
/**
* @returns array of cheerio instances representing the tables in the document
*/
parse(doc: string): string[][][];
/**
* Given a list of <tr>s, return a list of text rows.
*
* @see Any cell with `rowspan` or `colspan` will have its contents copied
* to subsequent cells.
* @param $rows list of cheerio instances representing rows
* @returns array of array, each returned row is a list of string text.
*/
private expandColspanRowspan;
/**
* Return the list of row elements from the parsed table element.
*
* @param $table the table to parse
* @returns array of cheerio instances representing the rows in the table
*/
private parseTr;
/**
* @param $row the row to parse
* @returns array of cheerio instances representing the cells in the row
*/
private parseTd;
}
export { CheerioTableParser };
//# sourceMappingURL=parser.d.ts.map