Skip to content

Instantly share code, notes, and snippets.

@lukaskollmer
Created September 23, 2018 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukaskollmer/378592e8746f0d249831396af13ddb11 to your computer and use it in GitHub Desktop.
Save lukaskollmer/378592e8746f0d249831396af13ddb11 to your computer and use it in GitHub Desktop.
Extract download urls from archives.gov
// Extracts the download urls from a table of links to files
// 1. run the script below in your browser's console
// 2. copy the printed urls, save to text file
// 3. `wget -i YOUR_TEXT_FILE`
const main = document.getElementById('block-system-main');
const table = main.children[main.children.length - 1].children[0].children[0];
const rows = Array.from(table.children[0].children)
rows.splice(0, 1)
console.log(rows.map(row => row.children[0].children[0].href).join('\n'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment