GithubHelp home page GithubHelp logo

bradparks / navalia__not-your-father-s-web-driver Goto Github PK

View Code? Open in Web Editor NEW

This project forked from joelgriffith/navalia

0.0 1.0 0.0 2.28 MB

Not your father's web driver

Home Page: https://joelgriffith.github.io/navalia/

License: GNU General Public License v3.0

JavaScript 0.71% TypeScript 99.29%

navalia__not-your-father-s-web-driver's Introduction

Navalia

npm version Build Status dependencies Status styled with prettier

npm install --save navalia

View the documentation here

Automate and scale browser workflows with a sane API. Navalia exports a handy Navalia module that acts as browser-load balancer, as well as a Chrome module that you can use for an easier experience.

Usage

BETA WARNING This project heavily relies on bleeding-edge technology, as such the API and internals will likely change from time to time. I heavily recommend that you install Chrome Canary to capture the latest and greatest the browser has to offer.

Features

  • Runs and controls multiple instances of particular browser (currently Chrome).
  • Capture screenshots, pdfs, execute javascript, insert text, and more.
  • Queue work automatically when all instances are busy.
  • Uses a simple, easy to understand API.
  • Work can easily span over multiple pages or complex interactions.
  • Set timers and max-jobs limitations on browsers, forcing them to reboot for easier memory management.

Navalia Example

// Navalia manages browser instances
// and can jobs can be queued against it
const { Navalia } = require('Navalia');
const navalia = new Navalia();

navalia.register((chrome) => {
  return chrome.goto('http://www.google.com/')
    .then(() => chrome.pdf('/Users/jgriffith/Downloads/google.pdf'));
});

navalia.register((chrome) => {
  return chrome.goto('http://www.facebook.com/')
    .then(() => chrome.pdf('/Users/jgriffith/Downloads/facebook.pdf'));
});

Chrome Example

// Simple, easy to use Chrome wrapper
import { Chrome } from 'navalia';

const chrome = new Chrome();

async function screenshotHN() {
  await chrome.goto('https://news.ycombinator.com/');
  await chrome.click('a')
  await chrome.wait(500);
  await chrome.screenshot('/Users/jgriffith/Downloads/hn.png');
  return chrome.done();
}

screenshotHN();

More Examples

Looking for more? Check out the docs.

Roadmap

In no particular order, this is the vision of navalia going forward:

  • Expanded browser API (pdf rendering, network watching, more).
  • Bring more vendors onto the framework.
  • Better typings around externals with no @type support.
  • Parameterization on killing long-running jobs.
  • Unit testing all features.
  • Integration testing with the various vendors so our API's don't break when theirs do.
  • Travis, coveralls, greenkeeper, and other handy-dandy tools to automate chore tasks.

navalia__not-your-father-s-web-driver's People

Contributors

joelgriffith avatar mute avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.