Natural-language web automation using Puppeteer.
Write in natural language (following the Commands section). For example, you can create a file with the following set of commands:
path/to/download.puppet:
Go to typeform.com
Click on the login link
Type username user@example.com
Type password 3rjiw9qie2308
Click on login button
Take a screenshot
Download https://admin.typeform.com/export
Save to to report.csv
Then, run the command:
puppet "path/to/download.puppet"
Install the package globally from npm:
npm install --global puppet
# Local Puppet file
puppet "path/to/commands.puppet"
# Remote Puppet file
puppet https://pastebin.com/raw/AeY1MAwF
# Commands directly in CLI
puppet "open example.com" "get page HTML" "save as page.html"
Import and use the API:
const { puppet } = require("puppet"); // Node.js
import { puppet } from "puppet"; // TypeScript/ES6
// Local Puppet file
await puppet("path/to/commands.puppet");
// Remote Puppet file
await puppet("https://pastebin.com/raw/AeY1MAwF");
// Commands directly as an array of strings
await puppet(["open example.com", "get page HTML", "save as page.html"]);
Go to example.comNavigate to URL https://example.comGo to the page on example.comOpen www.example.comWait for 10 secondsWait for 2 minutesWait for 100msWait for navigationTake a screenshot of this pageTake a JPEG screenshotFull screenshot this pageMake a transparent screenshotScreenshot and omit the backgroundSave this page as PDFSave page HTMLGet the HTMLSave the whole page as PDFSave result to path/to/fileSave this screenshot to path/to/fileSave this to the file path/to/fileClick on point [123, 456]Right click on coordinates 123, 456Move mouse cursor to points 123, 456Click on 123, 456 using middle mouse buttonBuild TypeScript:
npm run build
Run unit tests and view coverage:
npm run test-without-reporting
Thanks goes to these wonderful people (emoji key):
Anand Chowdhary 🤔 💻 ⚠️ 📖 | Gajus Kuizinas 🚇 |
This project follows the all-contributors specification. Contributions of any kind welcome!