Skip to content

Instantly share code, notes, and snippets.

@georgettica
Last active December 5, 2021 15:37
Show Gist options
  • Save georgettica/2bab7ebf56cea77167e7af421d9cdfaf to your computer and use it in GitHub Desktop.
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
// 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)))
@georgettica
Copy link
Author

.mjs is used to add all of the required node_modules to make this actually self contained

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment