Developers February 21, 2020

Automated screenshot tool

Matt Hegarty @mashdog

Hi
I have to take ~600 screenshots of the same portion of the screen. Ideally I could just cycle through the views and press a button to have a png dropped automatically into a folder.

Does anyone know of any tool which can do this? Linux ideally.

  1. 3

    I think Puppeteer would be best. It's a headless Chrome browser with a screenshot method built in.

    1. 1

      Will take a look - thanks for the reply.

      1. 1

        If you knows a bit Javascript and Firebase, I published last year a blog post to display how a screenshot could be taken in the cloud using Puppeteer. Could be a handy way to automate the process without anything running locally.

        https://dev.to/daviddalbusco/how-to-take-a-screenshot-of-a-website-in-the-cloud-j53

        Just in case that would help.

  2. 1

    Thanks to all who replied. I ended up going with import (part of ImageMagick). It took a bit of tweaking, but worked fine in the end.

    I had a bash script to open Chrome, take the screenshot and repeat for 679 pages.

  3. 1

    That would be scrot. I used to use it a couple year before. Check it out.

    1. 1

      Thanks Simon - will take a look

  4. 0

    Not meaning to overtake this thread, but in my fightnight scores project I really want users to be able to to take a screenshot of their scorecard and be able to tweet it.

    I found a JS tool called HTML2Canvas (https://html2canvas.hertzen.com/) which generates the html elements within a specific div or section of the website and creates it as an image. I have got this to then be displayed into a modal popup. This could be something the OP could make use of potentially?

    An issue I am having with it is blurred images and fonts generated by the script. Maybe this is fixable though with some time and adjusting before the script runs.

    The other issue I have not tackled is integrating this to a tweet button which either opens twitter on the users mobile device or on desktop opens up a new window going to twitter with the image uploaded ready to tweet.

    I have implemented a basic text tweet button for the site where a tweet message is generated within the popup tweet window but not an image tweet.

    Anyone any ideas on going about this.

    Also maybe there is a need for these two actions (screen shot a specific section of a website followed by the tweet / image share) to be a product in itself?

    1. 2

      Thanks Anton - this tool would be very useful to me if it was not blurring. I'll take a look though.

  5. 1

    This comment was deleted 2 months ago.