https://github.com/kevcui/putility
:wrench: Puppeteer script-kit
https://github.com/kevcui/putility
puppeteer scripting scriptkit
Last synced: about 1 month ago
JSON representation
:wrench: Puppeteer script-kit
- Host: GitHub
- URL: https://github.com/kevcui/putility
- Owner: KevCui
- License: mit
- Created: 2020-04-24T08:19:57.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-02-16T20:03:48.000Z (over 5 years ago)
- Last Synced: 2025-03-26T17:40:11.127Z (about 1 year ago)
- Topics: puppeteer, scripting, scriptkit
- Language: JavaScript
- Size: 13.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
putility
=========
putility.js is a [puppeteer](https://github.com/puppeteer/puppeteer/) script toolkit. It contains some small and useful functions for daily usage.
## Dependency
- [puppeteer-core](https://github.com/puppeteer/puppeteer/): core library of puppeteer, headless Chrome
- [commander](https://github.com/tj/commander.js): argument options parser
## Installation
```bash
npm i puppeteer-core commander
```
## How to use
```
Usage: ./putility.js [-u ] [-w ] [-p ] [-c ] [-s]
Options:
-u, --agent optional, browser user agent
-w, --wait optional, wait for n milliseconds
-p, --path optional, path to chrome/chromium binary
default "/usr/bin/chromium"
-c, --cmd optional, one or multiple commands:
["html", "screenshot", "cookie", "header"]
default "html"
-s, --show optional, show browser
default not show
-h, --help display help for command
```
## Function
- Take screenshot: `-c screenshot`, take screenshot of whole page
- Fetch HTML: `-c html`, dump tag as output text
- Fetch cookie: `-c cookie`, dump site cookie as output json
- Fetch response header: `-c header`, dump response header as output json