All Projects β†’ brandon93s β†’ html-table-to-json

brandon93s / html-table-to-json

Licence: MIT license
Generate JSON representations of HTML tables

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to html-table-to-json

html-table-extractor
extract data from html table
Stars: ✭ 74 (+89.74%)
Mutual labels:  scraping, html-table
etf4u
πŸ“Š Python tool to scrape real-time information about ETFs from the web and mixing them together by proportionally distributing their assets allocation
Stars: ✭ 29 (-25.64%)
Mutual labels:  scraping
scotch-scraping-node
Simple app for scraping author profiles and tutorials from Scotch.io - https://scotch.io.
Stars: ✭ 15 (-61.54%)
Mutual labels:  scraping
scrape-github-trending
Tutorial for web scraping / crawling with Node.js.
Stars: ✭ 42 (+7.69%)
Mutual labels:  scraping
pythonista-chromeless
Serverless selenium which dynamically execute any given code.
Stars: ✭ 31 (-20.51%)
Mutual labels:  scraping
gochanges
**[ARCHIVED]** website changes tracker πŸ”
Stars: ✭ 12 (-69.23%)
Mutual labels:  scraping
MachineLearning
Machine learning for beginner(Data Science enthusiast)
Stars: ✭ 104 (+166.67%)
Mutual labels:  scraping
socials
πŸ‘¨β€πŸ‘©β€πŸ‘¦ Social account detection and extraction in Python, e.g. for crawling/scraping.
Stars: ✭ 37 (-5.13%)
Mutual labels:  scraping
turtle
Instagram Photo Downloader
Stars: ✭ 15 (-61.54%)
Mutual labels:  scraping
info-bot
πŸ€– A Versatile Telegram Bot
Stars: ✭ 37 (-5.13%)
Mutual labels:  scraping
Goirate
Pillaging the seven seas for torrents, pieces of eight and other bounty.
Stars: ✭ 20 (-48.72%)
Mutual labels:  scraping
readability-cli
A CLI for Mozilla Readability. Get clean, uncluttered, ready-to-read HTML from any webpage!
Stars: ✭ 41 (+5.13%)
Mutual labels:  scraping
double-agent
A test suite of common scraper detection techniques. See how detectable your scraper stack is.
Stars: ✭ 123 (+215.38%)
Mutual labels:  scraping
Euro2016 TerminalApp
⚽ Instantly find πŸ†EURO 2016 live-streams & highlights, now a Web App!
Stars: ✭ 54 (+38.46%)
Mutual labels:  scraping
scrapers
scrapers for building your own image databases
Stars: ✭ 46 (+17.95%)
Mutual labels:  scraping
PythonScrapyBasicSetup
Basic setup with random user agents and IP addresses for Python Scrapy Framework.
Stars: ✭ 57 (+46.15%)
Mutual labels:  scraping
linkedin-scraper
Tool to scrape linkedin
Stars: ✭ 74 (+89.74%)
Mutual labels:  scraping
crawler-chrome-extensions
ηˆ¬θ™«ε·₯η¨‹εΈˆεΈΈη”¨ηš„ Chrome 插仢 | Chrome extensions used by crawler developer
Stars: ✭ 53 (+35.9%)
Mutual labels:  scraping
Architeuthis
MITM HTTP(S) proxy with integrated load-balancing, rate-limiting and error handling. Built for automated web scraping.
Stars: ✭ 35 (-10.26%)
Mutual labels:  scraping
trafilatura
Python & command-line tool to gather text on the Web: web crawling/scraping, extraction of text, metadata, comments
Stars: ✭ 711 (+1723.08%)
Mutual labels:  scraping

html-table-to-json Build Status

Extracts tables from a provided html snippet and converts them to JSON objects

Install

$ npm install html-table-to-json

Usage

const HtmlTableToJson = require('html-table-to-json');

const jsonTables = HtmlTableToJson.parse(`
        <table>
            <tr>
                <th>Animal</th>
                <th>Color</th>
                <th>Name</th>
            </tr>
            <tr>
                <td>Unicorn</td>
                <td>Pink</td>
                <td>Billy</td>
            </tr>
            <tr>
                <td>Walrus</td>
                <td>Orange</td>
                <td>Sue</td>
            </tr>
        </table>
    `);

console.log(jsonTables.results);
/* => [[
 *      {Animal: 'Unicorn', Color: 'Pink', Name: 'Billy'},
 *      {Animal: 'Walrus', Color: 'Orange', Name: 'Sue'}
 *    ]]
 */

console.log(jsonTables.count);
// => 1

API

HtmlTableToJson.parse(input [,options])

input

Type: string

Any html snippet.

options

Type: object

values

Type: bool

Return table rows as value arrays:

// HtmlTableToJson.parse(html, { values: true })
/* => [[
 *      ['Unicorn', 'Pink', 'Billy'],
 *      ['Walrus', 'Orange', 'Sue']
 *    ]]
 */

Headers

HtmlTableToJson extracts table headers ( th ) to be used as JSON object keys. The first row is used when no th elements are present.

License

MIT Β© Brandon Smith

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].