https://github.com/misterGF/echo
Echo converts HTML tables into JSON/CSV objects. Use it to make html data easy to transport.
https://github.com/misterGF/echo
Last synced: 17 days ago
JSON representation
Echo converts HTML tables into JSON/CSV objects. Use it to make html data easy to transport.
- Host: GitHub
- URL: https://github.com/misterGF/echo
- Owner: misterGF
- License: mit
- Created: 2016-02-09T18:03:40.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-06-24T16:06:34.000Z (almost 9 years ago)
- Last Synced: 2025-04-02T19:04:32.203Z (19 days ago)
- Language: JavaScript
- Size: 89.8 KB
- Stars: 288
- Watchers: 9
- Forks: 16
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-command-line-apps - Echo - Convert HTML tables to JSON/CSVs. (\*nix/\*nux / Conversion)
README
# Echo - Convert HTML tables to JSON/CSVs
Nix Build: TravisCI: Windows Build: AppVeoyr: 
NPM: 
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.
---## Install
```javascript
npm i "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.``` javascript
// 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');```
``` javascript
// 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');```
``` javascript
// 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!