Class SearchPage

class is designed to represent and manage the results of a search query on the Shinden.pl website. It handles the parsing of search result pages, navigation through multiple pages of results, and provides access to the individual search results.

Constructors

  • Creates an instance of SearchPage.

    Parameters

    • name: string

      The name of the search query.

    • Optional previousPage: SearchPage

      The previous search page.

    • Optional firstPageHTML: string

      The HTML content of the first search page.

    Returns SearchPage

Properties

_isFirst: boolean
_isLast: boolean
_name: string
_pageIndex: number
_searchResults: SearchResult[] = undefined
_totalPages: number = undefined

Methods

  • Gets the next page of search results.

    Returns Promise<SearchPage>

    The next search page.

    Throws

    Will throw an error if the current page is the last page.

  • Private

    Parses the search page HTML to extract search results.

    Parameters

    • Optional html: string

      The HTML content of the search page.

    Returns Promise<void>