@scaleleap/puppeteer
v1.1.56
Published
![](https://raw.githubusercontent.com/ScaleLeap/puppeteer/master/docs/assets/header.png)
Downloads
21
Readme
📦 @scaleleap/puppeteer
A Puppeteer convenience wrapper with stealth mode enabled by default.
Download & Installation
$ npm i -s @scaleleap/puppeteer
Usage
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
}
})
Helper Functions
clickAndWait(page: Page, selector: string, clickOptions?: ClickOptions, navigationOptions?: NavigationOptions)
Clicks and waits for network request to complete and resolves.
Environment Variables
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
Heroku
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
References
Contributing
This repository uses Conventional Commit style commit messages.
Authors or Acknowledgments
- Roman Filippov (Scale Leap)
License
This project is licensed under the MIT License.