A node.js program that will take a screenshot or snap an image from a web page and save it to a file.
Use chocolatey to install chromedriver and geckodriver.
cinst selenium-chrome-driver
cinst selenium-gecko-driver
Clone this repository. (Use the green clone button to the top right above.) Go to the imgsnapper directory and type:
yarn
yarn link
Just type imgsnapper
in your shell. Or imgsnapper --help
for a list of all command line options.
Take a screenshot of a web page, give it a timestamped filename and save it in the /images
folder.
imgsnapper -s -u https://www.sunet.se
Take a screenshot every 15 minutes
imgsnapper -s -u https://www.bbc.com/weather -r 15
Take a screenshot every minute and hide the browser window while doing it
imgsnapper -u https://trends.google.com/trends/explore?date=now%201-H&q=trump -s -r 1 -q
Go to the imgsnapper directory and type: yarn unlink
- Add command line arguments support
- Experimental firefox/geckodriver support. (Still throws an error.)
- Add --help
- Fix the help text so it says imgsnapper instead of
node.exe ./cli.js
- Make it possible to pick the image XPath rather than element id
- Add timestamped filenames for the image(s)
- Autodetect image type
- Create
/images
directory automatically - Save files in a directory (
/images
) - Make it possible to specify a different image directory
- Add option to run headless
- If not headless, run browser maximized for largest screenshot.
- Create a command for making all the images into a movie
- Add cron functionality
- Added lynt for linting the code.
- Use Yarn instead of NPM
- Update the README
- The chromedriver process doesn't terminate after program exits.
- The geckodriver variant crashes on program exit.
To find the XPath to an image in a web page, try the ChroPath plugin for Chrome.