UNPKG

@xcrap/core

Version:

Xcrap Core is the core package of the Xcrap framework for web scraping, offering tools such as HttpClient, BaseClient, Randomizer, Rotator, and support for proxies and pagination.

19 lines (18 loc) 567 B
import { HttpResponse } from "../http-response"; export type ClientRequestOptions = { url: string; method?: string; retries?: number; maxRetries?: number; retryDelay?: number; }; export type ClientFetchOptions = ClientRequestOptions; export type ClientFetchManyOptions<T = ClientFetchOptions> = { requests: T[]; requestDelay?: number; concurrency?: number; }; export interface ClientInterface { fetch(options: ClientRequestOptions): Promise<HttpResponse>; fetchMany(options: ClientFetchManyOptions): Promise<HttpResponse[]>; }