Convert web page to image [closed]

2019-01-01 12:33发布

问题:

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

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

回答1:

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/

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



回答2:

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.



回答3:

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.



回答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)



回答5:

Using Firefox, you will need the screengrab addon.



回答6:

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



回答7:

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)



回答8:

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.



回答9:

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



回答10:

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! =)