Skip to content

Instantly share code, notes, and snippets.

@brendannee
Created August 28, 2021 06:15
Show Gist options
  • Save brendannee/763fd11b13d968a7e4f5e4867a706629 to your computer and use it in GitHub Desktop.
Save brendannee/763fd11b13d968a7e4f5e4867a706629 to your computer and use it in GitHub Desktop.
Download a list of webpages as pdfs and use the last part of the path as the filename
while read p; do
DOWNLOADURL=$(echo $p | grep / | cut -d/ -f5 | awk '{print $1".pdf"}')
chrome --headless --print-to-pdf=$DOWNLOADURL $p; sleep 5
done <list.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment