@hanivanrizky/nestjs-html-parser
Version:
A powerful NestJS HTML parsing service with XPath and CSS selector support, proxy configuration, random user agents, and rich response metadata including headers and status codes
24 lines (23 loc) • 863 B
TypeScript
/**
* SSL and Dead Domain Handling Example
*
* This example demonstrates how to handle various network issues when scraping:
* - SSL certificate errors (expired, self-signed, invalid)
* - Dead domains (DNS resolution failures)
* - Connection timeouts and refused connections
* - Rate limiting and network issues
*
* These scenarios are common when scraping websites that may have
* configuration issues or become temporarily/permanently unavailable.
*/
interface ScrapeResult {
url: string;
success: boolean;
title?: string;
error?: string;
errorType?: string;
retryCount?: number;
}
declare function demonstrateSSLAndErrorHandling(verbose?: boolean): Promise<void>;
export declare function testUrlWithRobustConfig(url: string, verbose?: boolean): Promise<ScrapeResult>;
export { demonstrateSSLAndErrorHandling, ScrapeResult };