Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pedrohenriquebr/autonomous
Autonomous
https://github.com/pedrohenriquebr/autonomous
autonomous javascript nodejs puppeteer puppeteer-core
Last synced: 5 days ago
JSON representation
Autonomous
- Host: GitHub
- URL: https://github.com/pedrohenriquebr/autonomous
- Owner: pedrohenriquebr
- License: lgpl-3.0
- Created: 2019-11-22T09:47:43.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-06-05T15:59:28.000Z (over 3 years ago)
- Last Synced: 2025-01-28T20:36:54.321Z (17 days ago)
- Topics: autonomous, javascript, nodejs, puppeteer, puppeteer-core
- Language: JavaScript
- Homepage:
- Size: 54.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Autonomous
A puppeteer-core based library for Processes Automation.
## Installation
Follow the following steps:
```console
$ yarn add @pedrobr/autonomous
```
or```console
$ npm install --save @pedrobr/autonomous
```## Using
> Make sure you have the Google Chrome opened
```javascript
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:
```javascript
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();
})()
```