UNPKG

@hanivanrizky/nestjs-html-parser

Version:

⚠️ ARCHIVED - This package is no longer maintained. Please migrate to @hanivanrizky/nestjs-xpath-parser (https://github.com/Hanivan/nestjs-xpath-parser)

78 lines 3 kB
"use strict"; /** * @fileoverview NestJS HTML Parser Package * * ⚠️⚠️⚠️ DEPRECATED PACKAGE ⚠️⚠️⚠️ * * This package is ARCHIVED and NO LONGER MAINTAINED. * * Please migrate to the new package: @hanivanrizky/nestjs-xpath-parser * https://github.com/Hanivan/nestjs-xpath-parser * * Migration: * 1. npm uninstall @hanivanrizky/nestjs-html-parser * 2. npm install @hanivanrizky/nestjs-xpath-parser * 3. Update imports: '@hanivanrizky/nestjs-html-parser' → '@hanivanrizky/nestjs-xpath-parser' * * For details, see: https://github.com/Hanivan/nestjs-html-parser/blob/main/DEPRECATED.md * * --------------------------------------------------------------- * * A powerful NestJS package for parsing HTML content with comprehensive features: * * ## Features * - **XPath & CSS Selectors**: Extract data using XPath expressions or CSS selectors * - **Proxy Support**: Configure HTTP, HTTPS, SOCKS4, and SOCKS5 proxies with authentication * - **Random User Agents**: Rotate user agents to avoid detection * - **Rich Metadata**: Get response headers, status codes, and more * - **Retry Logic**: Configurable retry attempts with delays * - **Verbose Logging**: Detailed debugging information * - **Type Safety**: Full TypeScript support with comprehensive types * * ## Quick Start * ```typescript * import { HtmlParserModule, HtmlParserService } from '@hanivanrizky/nestjs-html-parser'; * * // In your module * @Module({ * imports: [HtmlParserModule], * }) * export class AppModule {} * * // In your service * @Injectable() * export class MyService { * constructor(private htmlParser: HtmlParserService) {} * * async getData() { * const response = await this.htmlParser.fetchHtml('https://example.com'); * const title = this.htmlParser.extractSingle(response.data, '//title/text()'); * return title; * } * } * ``` * * @author Hanivan Rizky Sobari <hanivan20@gmail.com> * @license MIT */ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./app.module"), exports); __exportStar(require("./examples"), exports); __exportStar(require("./html-parser.module"), exports); __exportStar(require("./html-parser.service"), exports); __exportStar(require("./types"), exports); //# sourceMappingURL=index.js.map