htmltable2csv
is a tool to parse a html table and store the data as csv, written to a file
or print to stdout
.
go get -u github.com/paulvollmer/htmltable2csv
brew install paulvollmer/tap/htmltable2csv
Download your preferred flavor from the releases page and install manually.
Usage: htmltable2csv [flags]
Flags:
-csv string
The csv filename. if empty, print csv to stdout
-selector string
The table css selector
-source string
The filepath or website url
-start int
The row to begin data result
-stop int
The row to end data result
-trim
Trim the whitespace for each table column
-v Print the version and exit
Examples:
htmltable2csv \
-source 'https://www.w3schools.com/html/html_tables.asp' \
-selector '#customers > tbody > tr' \
-csv data.csv \
-start 0 \
-stop 3