Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Scraper<T, SO>

Type parameters

Hierarchy

Implements

Index

Properties

Abstract defaultOptions

defaultOptions: SO

Abstract domains

domains: string[]

Abstract name

name: string

Abstract urlPattern

urlPattern: RegExp

Methods

changeOptions

  • changeOptions(options: Partial<SO>): SO

Protected Abstract exec

  • exec(url: string, options: SO): Promise<T>
  • Parameters

    • url: string
    • options: SO

    Returns Promise<T>

getOptions

  • getOptions(options?: Partial<SO>): SO

Protected getScrap

  • getScrap(url: string, dataSupplier: function): Promise<Scrap<T>>
  • Parameters

    • url: string
    • dataSupplier: function
        • (): Promise<T>
        • Returns Promise<T>

    Returns Promise<Scrap<T>>

getUrlData

  • getUrlData(url: string, throwIfNull: true): RegExpExecArray
  • getUrlData(url: string, throwIfNull: false): RegExpExecArray | null
  • Parameters

    • url: string
    • throwIfNull: true

    Returns RegExpExecArray

  • Parameters

    • url: string
    • throwIfNull: false

    Returns RegExpExecArray | null

isApplicable

  • isApplicable(url: string): boolean
  • Parameters

    • url: string

    Returns boolean

isApplicableDomain

  • isApplicableDomain(domain: string): boolean
  • Parameters

    • domain: string

    Returns boolean

scrap

  • scrap(url: string, options?: SO): Promise<Scrap<T>>

Static mergeOptions

  • mergeOptions<O>(o1: O, o2: Partial<O> | O | undefined): O
  • mergeOptions<O>(o1: O | Partial<O> | undefined, o2: O): O
  • mergeOptions<O>(o1: Partial<O> | undefined, o2: Partial<O>): Partial<O>
  • mergeOptions<O>(o1: Partial<O>, o2: Partial<O> | undefined): Partial<O>
  • mergeOptions<O>(o1: Partial<O> | undefined, o2: Partial<O> | undefined): Partial<O> | undefined

Generated using TypeDoc