Evaluation Functions
Evaluation functions in Waterfall-Fetch allow you to execute custom JavaScript code in the context of the fetched web page when using the Puppeteer strategy.What are Evaluation Functions?
An evaluation function is a user-defined function that takes apage
object as its parameter. This page
object represents the current state of the web page being interacted with, allowing you to execute JavaScript within the context of that page.
Syntax
Usage
You can pass an evaluation function as part of the options object when callinggetHtml
:
Use Cases
Evaluation functions are particularly useful for:- Extracting specific data from the page
- Interacting with the page (e.g., clicking buttons, filling forms)
- Waiting for dynamic content to load
- Bypassing client-side rendering issues