Skip to main content

getHtml Function

The getHtml function is the core of the Waterfall-Fetch library. It fetches HTML content from a specified URL using various strategies.

Syntax

Parameters

  • url (string): The URL to fetch HTML content from.
  • options (object, optional):
    • set (“cheap” | “js” | null): The strategy set to use. Default is null (uses all strategies).
    • evalFunction (function, optional): A custom evaluation function for use with Puppeteer.

Return Value

Returns a Promise that resolves to an HtmlResponse object:

Example Usage

You can customize the strategy set used by Waterfall-Fetch. Check out the Advanced Usage section to learn how to create and use custom strategy sets.