69

What are some utilities to obtain an image of a webpage?

Basically equivalent to taking a "screenshot" of the page after opening it.

Michael
  • 10,124
  • 1
  • 34
  • 49
jrharshath
  • 25,975
  • 33
  • 97
  • 127
  • 1
    Here's a real world business case for you: Professional display boards (those expensive 24 hour TVs) need a constant image source and commonly use FTP to show images rather than streams, like a dynamic slideshow. When the company wants to present dynamic content, e.g. status from monitoring tools or a selection of real (almost live) web pages and reports. Then you need to grab web sites/GUIs (many monitoring tools and business tools now have web GUIs) and save them to images so the TV can show them. – Tony Wall Jan 14 '16 at 09:03
  • 12
    This question is clear on what it's asking. It is not ambiguous, vague, incomplete, overly broad nor rhetorical. It has been reasonably answered in its current form. It is just another trigger-happy stackoverflow user doin' it for the ego, and reducing the quality of stackoverflow. – user3791372 Jan 23 '16 at 21:33
  • @jrharshath friend you got answer ? i have similar doubt . Could you please chek this https://stackoverflow.com/questions/44602309/making-a-proper-image-capture-of-screen-using-jquery – Abilash Erikson Jun 18 '17 at 05:01
  • Tutorial here http://www.freakyjolly.com/convert-html-document-into-image-jpg-png-from-canvas/ – Code Spy Jun 08 '18 at 09:43
  • There is the [ApiFlash screenshot API](https://apiflash.com/) that allows you to do that fairly simply. – Timothée Jeannin Jan 28 '19 at 10:23

10 Answers10

53

Real answers:

http://cutycapt.sourceforge.net/

http://iecapt.sourceforge.net/

http://www.websitescreenshots.com/

http://www.princexml.com/

http://khtml2png.sourceforge.net/

http://linkpeek.com/

https://htmlcsstoimage.com/ (Uses Google Chrome)

https://gofullpage.com/ - Full Page Screen Capture (Chrome extension) - see this superuser answer for more info

(Don't know of one to use Mozilla's renderer, though.)

Will Ediger
  • 893
  • 9
  • 17
Stobor
  • 44,246
  • 6
  • 66
  • 69
20

Awesome : http://wkhtmltopdf.org/

wkhtmltopdf and wkhtmltoimage are open source (LGPLv3) command line tools to render HTML into PDF and various image formats using the QT Webkit rendering engine.

Stephan Schielke
  • 2,744
  • 7
  • 34
  • 40
PiX
  • 9,705
  • 4
  • 19
  • 11
6

Somebody wrote a blog post about this a few years back. There are examples in several languages, using both WebKit and Mozilla. There's also an example in Ruby.

It boils down to this: decide how wide you want your window to be; put a browser component in the window; wait until the page loads; capture the pixel buffer contents.

Jim Puls
  • 79,175
  • 10
  • 73
  • 78
4

http://code.google.com/p/wkhtmltopdf/ again..

Somebody mentioned this already.. I will write about it in more detail...

Contrary to what the name implies, there is html page to image converter as well.
It supports png and jpeg.
One can modify the user agent string of all requested urls and minimum width and height of the webpage.
It is possible to add new headers and set it for all requests.
It works on Windows and Linux.
It can ignore webpage errors.
It uses Webkit and Qt library. It installs easily, no additional libaries are needed
(everything is included in the distribution).
It is free and regularly updated. There are binaries available for both Linux and Windows.
It can handle flash on Windows. (It may do so on Linux as well, untested)

Aftershock
  • 5,205
  • 4
  • 51
  • 64
3

Using Firefox, you will need the screengrab addon.

GEOCHET
  • 21,119
  • 15
  • 74
  • 98
marknt15
  • 5,047
  • 14
  • 59
  • 67
2

You can also use "gnome-web-photo" as a command line tool to screenshot a webpage.

null
  • 21
  • 1
1

Give it a try: http://convertwebpage.com — this is a web-application that can convert web-pages into images (jpg, png) or into pdf and has some options.

melnaron
  • 21
  • 3
1

I'm not sure if this is quite what you're looking for but I've had a lot of success using an HTML to Postscript converter html2ps to create postscript copies of web pages, which I then convert to .gif or .pngs

This doesn't produce exact screenshot quality that you'd get from a web browser and doesn't handle complicated things like flash or css all that well, but the advantage is that you can run it on the web server.

(I use it to create thumbnails of user created content, for navigation)

Colin Coghill
  • 1,549
  • 15
  • 18
0

Not sure if this is what you want but this is what I do sometimes in a pinch when certain websites are not saving right.

I just print them to PDF and I get a PDF file of the 'print output'. There's an Microsoft XPS Document writer under my list of printers as well, but I don't use it.

Hope this helps! =)

wai
  • 8,923
  • 4
  • 24
  • 19
  • neaope.. not what I wanted, exactly.. I wanted a commandline tool to do that, and found it in the other answers, too! thanks anyway! – jrharshath Jun 09 '09 at 05:13
-1

You could use imagemagick and write a script that fires everytime you load a webpage.

kylex
  • 14,178
  • 33
  • 114
  • 175