@pedrobr/autonomous

0.10.0 • Public • Published

Autonomous

A puppeteer-core based library for Processes Automation.

Installation

Follow the following steps:

$ yarn add @pedrobr/autonomous

or

$ npm install --save @pedrobr/autonomous

Using

Make sure you have the Google Chrome opened

let autonomous = require('./index');
autonomous
    .task('task1')
    .newPage()
    .goto('http://www.google.com')
    .type("input[name='q']", "Why do I have to use Puppeteer ?")
    .waitForSelector("input[name=btnK]")
    .click("input[name=btnK]")

autonomous
    .build()
    .run()

It's build a new source code on main.autonomous.js:

const task1 = (async () => {
   const ikCGDtuCgA = await autonomous._browser.newPage()
   await ikCGDtuCgA.goto("http://www.google.com")
   await ikCGDtuCgA.type("input[name='q']","Why do I have to use Puppeteer ?")
   await ikCGDtuCgA.waitForSelector("input[name=btnK]")
   await ikCGDtuCgA.click("input[name=btnK]")

});

const autonomous = require('./index');
(async () => {
   await autonomous.startConnection('localhost',9444);
   await task1();
   await autonomous.closeConnection();
})()

Yes, this is a very ugly thing 🤓

This is basic library on progress...

Package Sidebar

Install

npm i @pedrobr/autonomous

Weekly Downloads

2

Version

0.10.0

License

GPLv3

Unpacked Size

19.6 kB

Total Files

7

Last publish

Collaborators

  • pedrobr