Rize is a high-level, fluent and chainable API provided library which let you use puppeteer simply.

“Rize” is too much like/incorporate /, not /raɪzɪ/. “Rize” is one of characters in is the Order a Rabbit? .

Installation

You should install puppeteer at the same time.

yarn add --dev puppeteer rizeCopy the code

or via npm:

npm install --save-dev puppeteer rizeCopy the code

If you are in China, you may specify Chromium binary mirror.

On Linux or macOS:

PUPPETEER_DOWNLOAD_HOST=https://storage.googleapis.com.cnpmjs.org yarn add --dev puppeteer rizeCopy the code

On Windows:

SET PUPPETEER_DOWNLOAD_HOST=https://storage.googleapis.com.cnpmjs.org yarn add --dev puppeteer rizeCopy the code

Basic Usage

Import

It’s recommended to use ES-style import:

import Rize from 'rize'Copy the code

Or using CommonJS-style import, if you don’t use any build tools:

const Rize = require('rize')Copy the code

Getting Started

Just like this:

const rize = new Rize()Copy the code

You can pass some options to the constructor, and these options are puppeteer‘s options:

const rize = new Rize({ headless: false })Copy the code

All Rize‘s APIs are chainable, so you can do something like this:

const rize = new Rize() rize .goto('https://github.com/') .type('input.header-search-input', 'node') .press('Enter') .waitForNavigation() .assertSee('Node.js') .end() // Don't forget to call `end` function to exit  browser!Copy the code

All available APIs are listed here.

Documentation

Please visit rize.js.org

License

MIT License

Copyright (c) 2018-present Pig Fang