Miss any of our Open RFC calls?Watch the recordings here! »

orbita

5.4.0 • Public • Published

orbita

Framework for automated web surfing with Electron for testing or crawling websites. Works as node-process.

NPM version Build Status Dependency Status Coverage percentage experimental

Install

npm install orbita --save
or
yarn add orbita

Usage

import { sel, Window } from "orbita";
const window = new Window();
async function start() {
    await window.open("http://www.google.com");
    await window.input('input[name="q"]', "github");
    await window.click("[name=btnK]");
    await window.waitForNextPage();
    const links = await window.grab(sel("div.g", [])); // grab with page-grabber module
    console.log("Number of links: " + links.length);
    await window.close();
}
start();

API

Window

interface IWindowConfig {
    userDataDir?: string;
    proxy?: string;
    userAgent?: string;
}
constructor(config?: IWindowConfig);
click(selector: string): Promise<void>;
isVisible(selector: string): Promise<boolean>;
waitForNextPage(): Promise<string>;
url(): Promise<string>;
open(url: string): Promise<string>;
input(selector: string, text: string): Promise<void>;
grab<T>(conf: T, context?: string): Promise<T>;
close();

Test

npm install
npm test

Keywords

none

Install

npm i orbita

DownloadsWeekly Downloads

7

Version

5.4.0

License

ISC

Unpacked Size

90.1 kB

Total Files

49

Last publish

Collaborators

  • avatar