How can I render a website as an image from the shell?

Posted on

Problem :

Looking to say “http://example.com/index.html -o website.png”

Is there an existing program to do this? I’m ok with doing html to png. Is there a program for that?

Solution :

TL;DR; Try wkhtmltopdf.org

Original Answer: (2011 — before question tags added)

Check the answer to this question. It seems the same as yours: https://stackoverflow.com/questions/125951/command-line-program-to-create-website-screenshots-on-linux

If it’s on Windows, check also:

Updated Answer:

A few other console / terminal based tools that can convert HTML to images.

They are both cross OS, free, and very popular.

quick search turns up this program

Main features

  • Create full size screenshots of website pages.
  • Supports JPG, GIF, PNG, BMP image formats.
  • Supports command line usage.
  • Supports batch convert with command line.
  • Simple, very fast and easy-to-use.
  • Freeware, not paid for use.

While it is no direct solution, the browsershots project is open source and basically provides what is requested here.

Leave a Reply

Your email address will not be published. Required fields are marked *