A Puppeteer convenience wrapper with stealth mode enabled by default.
$ npm i -s @scaleleap/puppeteer
Exports everything the same as puppeteer-core
package.
In addition to that, launch
method is amended to include an extra
option that can enable or
disable puppeteer-extra
behavior.
Also executablePath
is set, and headless
is set via PUPPETEER_HEADLESS
environment variable.
import { launch } from '@scaleleap/puppeteer'
const await browser = launch({
extra: {
// is true by default, but we are just showing the example
stealth: true
}
})
clickAndWait(page: Page, selector: string, clickOptions?: ClickOptions, navigationOptions?: NavigationOptions)
Clicks and waits for network request to complete and resolves.
The following environment variables are available:
PUPPETEER_EXECUTABLE_PATH
- the location of the Puppeteer executable.GOOGLE_CHROME_BIN
- same as above, but only used inside Heroku buildpack.PUPPETEER_HEADLESS
- Whether or not it should run in headless mode. Default:true
For Heroku deployments, use a heroku/google-chrome
buildpack.
This package will get the Chrome locations from the environment variable provided by the buildpack.
## make sure we are using NodeJS
heroku buildpacks:set heroku/nodejs
## now add chrome buildpack
heroku buildpacks:add heroku/google-chrome
This repository uses Conventional Commit style commit messages.
- Roman Filippov (Scale Leap)
This project is licensed under the MIT License.