puppeteer-evals

puppeteer-evals is a Node.js package that provides a set of utility functions for working with Puppeteer, making it easier to extract information from web pages.

Installation

You can install puppeteer-evals using npm:

npm install puppeteer-evals

Usage

First, import and initialize the package:

const evals = require('puppeteer-evals');
evals();

// Or, you can use it in one line:
// require('puppeteer-evals')();

After initialization, all functions can be called directly without referencing 'evals' again.

Example usage (assuming you've set up Puppeteer and have a 'page' object):

const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://example.com');

// Now you can use the evals functions:
const inputValues = await getInputs(page);
const buttonTexts = await getButtons(page);
const usernameValue = await getAttribute(page, 'input[name="username"]', 'value');

await browser.close();

Available Methods

Here's a list of available methods:

For more details on each method, you can use the help() function after initialization.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License.