Screenshot websites via a command-line-interface
git clone https://github.com/Booligoosh/screenshot-cli.git
cd screenshot-cli
npm install
Once this is done, add this to your bash preferences file (in this example I am using ~/.bashrc
) and source it:
echo "alias screenshot='<path-to-screenshot-folder>/pic-simple.js'" >> ~/.bashrc
source ~/.bashrc
screenshot -u <url> -p <folder-path> -n <filename-without-extension>
You can also supply a custom resolution for the screenshot by providing the -w and -h flags
screenshot -u <url> -p <folder-path> -n <filename-without-extension> -h <height> -w <width>
Contributions are welcome. Please see the issues, or add anything that your brain can conjure up!
This project was based on A Guide to Automating & Scraping the Web with JavaScript (Chrome + Puppeteer + Node JS), a really awesome article that you should check out.