Last active
December 5, 2021 15:37
-
-
Save georgettica/2bab7ebf56cea77167e7af421d9cdfaf to your computer and use it in GitHub Desktop.
read data from an html webpage that displays a directory index without using grep/sed/awk to parse the data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run this by copying to your machine, changing the URL variable and running using `node parse-html-table.mjs` | |
import fetch from 'node-fetch'; | |
import parse from 'parse-apache-directory-index'; | |
const URL = '' | |
fetch(URL) | |
.then(response => response.text()) | |
.then(text => console.log(parse(text))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
.mjs
is used to add all of the required node_modules to make this actually self contained