Giter Club home page Giter Club logo

navalia's Introduction

Navalia Logo

npm version Build Status dependencies Status styled with prettier

DEPRECATION WARNING: Unfortunately it's time for me to deprecate this library as I cannot give it the time it needs. If you're interested in maintaining this lib, send me message (joel at joelgriffith dot net). I'd recommend using something like chromeless or puppeteer if possible. Thanks!

The bullet-proof, fast, and most feature-rich Chrome driver around. Navalia lets you interact with Chrome and run parallel work with ease. Not using JavaScript? There's a GraphQL server that you can use to communicate with over HTTP allowing any runtime to drive Chrome.

Features

  • Scrape webpage data, even from JavaScript-heavy sites.
  • Run automated functional tests.
  • Discover visual regressions in your site.
  • Capture screenshots, pdfs, execute javascript, insert text, and more.
  • The largest API for interacting with Chrome.

GraphQL Front-end

Simply run navalia with a specified port e.g.

$ npm i -g navalia
$ navalia --port 4000

NavaliaQL

Recipes

Usage

The API for interacting with a browser is simple and chainable. You can call all methods individually and await/then the resulting value, or chain multiple together and collect their responses in a single result.

Chaining

const { Chrome } = require('navalia');
const chrome = new Chrome();

chrome
  .goto('https://amazon.com')
  .type('input', 'Kindle')
  .click('.buy-now')
  .end()
  .then((responses) => {
    console.log(responses); // ['https://www.amazon.com/', true, true, true]
  });

Await

import { Chrome } from 'navalia';
const chrome = new Chrome();

async function buyItOnAmazon() {
  const url = await chrome.goto('https://amazon.com');
  const typed = await chrome.type('input', 'Kindle');
  const clicked = await chrome.click('.buy-now');

  chrome.done();

  console.log(url, typed, clicked); // 'https://www.amazon.com/', true, true
}

buyItOnAmazon();

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's People

Contributors

joelgriffith avatar basarat avatar edparsons avatar elisherer avatar jessehattabaugh avatar matthewkosloski avatar mute avatar

Watchers

James Cloos avatar Arivu Arumugam 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.