Last active
August 22, 2018 08:00
-
-
Save betafcc/9af843e4e5fed429c52cc77c0598e524 to your computer and use it in GitHub Desktop.
Take screenshot from all urls in a file
This file contains hidden or 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
npm i -g slugify-cli | |
npm i -g puppeteer-screenshot-cli | |
print_all() { | |
urls="$1" | |
output="$2" | |
mkdir -p "${output}" | |
cat "${urls}" | | |
while read line | |
do | |
echo printing "${line}" | |
puppeteer-screenshot \ | |
--url "${line}" \ | |
--output ${output}/$(slugify "${line}").jpg \ | |
-w 1024 -h 768 | |
done | |
} | |
print_all "$1" "$2" | |
# usage: sh screenshot_all.sh <urls_file> <output_dir> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment