GithubHelp home page GithubHelp logo

tekniktjek / echo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mistergf/echo

0.0 2.0 0.0 89 KB

Echo converts HTML tables into JSON/CSV objects. Use it to make html data easy to transport.

License: MIT License

JavaScript 100.00%

echo's Introduction

Echo - Convert HTML tables to JSON/CSVs

Echo is able to read tables from a website or a html file and convert it to JSON or CSV. Perfect for saving data from a website and loading it into excel, database, etc.

Echo Icon

Install

npm install echo-table-2-file

Example usage

For our examples we will be using the tables from www.coolgithubprojects.com. We use .convert for local HTML files and .convertUrl for online retrieval.

// Site was saved locally in process folder. The follow code will read it and generate the json.
var echo = require('echo-table-2-file');
echo.convert('process', 'output', 'json');
// Here we grab the tables from the site and save the data to a csv (default type).
var echo = require('echo-table-2-file');
echo.convertUrl('https://www.coolgithubprojects.com', 'output');
// Lastly, we filter the tables to only include the month table (based on table ID).
var echo = require('echo-table-2-file');
echo.convertUrl('https://www.coolgithubprojects.com', 'output', 'months');

/* OUTPUT EXAMPLE : ./output/month.csv

  "0","Language","Change","Name"
  "","JavaScript","+5607","iojs/io.js"
  "","Go","+5439","golang/go"
  "","Other","+4581","prakhar1989/awesome-courses"
  "","JavaScript","+4045","dimsemenov/PhotoSwipe"
  "","PHP","+3284","isohuntto/openbay"
  ...

*/

Contributing

Pull requests welcome!

echo's People

Watchers

 avatar  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.