Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hanwentao/html2csv
A utility that extracts tables from HTML documents and converts them to CSV format
https://github.com/hanwentao/html2csv
command-line convert csv html table
Last synced: 15 days ago
JSON representation
A utility that extracts tables from HTML documents and converts them to CSV format
- Host: GitHub
- URL: https://github.com/hanwentao/html2csv
- Owner: hanwentao
- License: mit
- Created: 2019-07-05T15:23:26.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-06-03T11:57:58.000Z (over 1 year ago)
- Last Synced: 2024-03-14T20:20:18.388Z (8 months ago)
- Topics: command-line, convert, csv, html, table
- Language: Python
- Homepage:
- Size: 15.6 KB
- Stars: 35
- Watchers: 3
- Forks: 10
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# html2csv
[![Build Status](https://travis-ci.com/hanwentao/html2csv.svg?branch=master)](https://travis-ci.com/hanwentao/html2csv)
`html2csv` is a utility that extracts tables from HTML documents and converts them to CSV format, written in Python.
[![asciicast](https://asciinema.org/a/259747.svg)](https://asciinema.org/a/259747)
## Setup
Python 3 is required (version >=3.6). Install `html2csv` by `pip`.
```
pip install html-to-csv
```Yes, the package name is `html-to-csv` due to collision ;-)
## Examples
Input from the standard input, and output to the standard output.
html2csv
Input from a file, and output to the standard output.
html2csv example.html
Input from files, and output to a file.
html2csv example1.html example2.html -o output.csv
Input from the network, and output to the standard output.
html2csv http://example.com
## Usage
```
usage: html2csv [-h] [-o [OUTPUT]] [-e ENGINE] [-V] [input [input ...]]Convert HTML table to CSV format.
positional arguments:
input input sources (files, URLs, etc., default: standard
input)optional arguments:
-h, --help show this help message and exit
-o [OUTPUT], --output [OUTPUT]
output target (default: standard output)
-e ENGINE, --engine ENGINE
HTML parser engine (default: html.parser or lxml if
installed)
-V, --version display version
```## Author and Contact
Wentao Han ([email protected])