1

Possible Duplicate:
How can I take screenshots with Perl?

How can I take a screenshot from a site (in batch mode) using Perl? I.e. solution should produce image file (say .png) given an URL. It would be nice, if no X Window system will be required for solution to work.

Community
  • 1
  • 1
Egor Makarov
  • 75
  • 1
  • 6

3 Answers3

3

I'd use WWW::Mechanize::Firefox. Unfortunately it does need X (at least on non-OS X *NIX), but you can use xvfb to run it headless.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
2

In the past I needed to convert a web page to PDF. I used http://code.google.com/p/wkhtmltopdf/ and it worked beautifully (it's using the excellent WebKit engine). Problem is it's not Perl-based and it doesn't produce an image, but a PDF. Try it, it might suit your needs (` No longer requires an XServer to be running (however the X11 client libs must be installed' )

brian d foy
  • 129,424
  • 31
  • 207
  • 592
nc3b
  • 15,562
  • 5
  • 51
  • 63
1

If your going to go beyond screen shots, finding a binding for Watir would be my advice. The ability to get javascript, java/flash/activex embedd scripting working is nice (for some value of nice)

hpavc
  • 1,336
  • 7
  • 7