Naughty Programmer's Madness

    chrome-drone

    0.15.3 • Public • Published

    Chrome Drone

    npm version

    Autonomously control the chrome browser

    🚨 Minimum Chrome Version 🚨

    You must have Chrome version 61.XX or greater installed

    Installation

    npm install chrome-drone

    Sample Usage

    const { createDrone, goTo, setValue, click, evaluate, waitForLoadingToFinish, kill } = require('chrome-drone');
     
    async function stockPrice(symbol) {
      const drone  = await createDrone({headless: true});
      try {
        await goTo(drone, 'https://duckduckgo.com/');
        await setValue(drone, '#search_form_input_homepage', `stock quote ${symbol}`);
        await click(drone, '#search_button_homepage');
        await waitForLoadingToFinish(drone, 30000);
        const priceLastTrade = await evaluate(drone, `document.querySelector('span.stocks__quote.text--primary').innerText`);
        console.log(`Price of last trade: ${priceLastTrade}`);
      } finally {
        await kill(drone);
      }
    }
     
    stockPrice('QTWO');

    API Documentation

    API

    Run Tests

    npm test

    Debugging options

    • drone-requests
    • drone-cookies
    • drone-blacklist
    • drone-loading

    Install

    npm i chrome-drone

    DownloadsWeekly Downloads

    5

    Version

    0.15.3

    License

    MIT

    Last publish

    Collaborators

    • unbill