tags:

views:

333

answers:

4

Are there bindings for layout engines like Gecko or WebKit for Perl? I found Gtk2-Webkit on CPAN but I would like to know if there are other options.

My idea is to use one of those engines to create thumbnails of web pages from a Perl script.

+9  A: 

I haven't tried it myself, but the documentation for WWW::Mechanize::FireFox looks pretty impressive.

Update:

Tried it now. This rocks. You can indeed remote-control Firefox whatever way you want and create screen-shots easily.

innaM
I don't see a way to create screenshot from it's documentation.
Alexandr Ciornii
Look at the content_as_png method.
innaM
+3  A: 

XUL::Gui allows you to create GUI applications using Firefox. I am not sure if this corresponds to your needs, but it would be an interesting module to examine.

Update: XUL::Gui indeed is an interesting module to examine, but I did not realize how far WWW::Mechanize::Firefox had come.

Sinan Ünür
But I think that XUL::Gui supports only a subset of HTML and there is no way to have an image of the rendered content.
munissor
XUL::Gui supports all of HTML, all of XUL, and any other tag you want (created at runtime with the 'tag' and 'object' functions). @munissor => speaking as the author, was there anything in the XUL::Gui documentation that implied a limited subset? if so I'll be sure to fix it.
Eric Strom
I agree with Sinan though that WWW::Mechanize::Firefox is probably a better fit for this task.
Eric Strom
+2  A: 

Also Gtk2::MozEmbed

Alexandr Ciornii
+1  A: 

There's also Wx and just plain Gtk

mpeters