#!/usr/bin/perl -w use warnings; use strict; use WWW::Mechanize::Firefox; my $url = "http://cmcc.deviantart.com"; my $outfile = "MyScreenshot.png"; my $telnet_max_buff_len = 10485760; my $mech = WWW::Mechanize::Firefox->new( launch => 'firefox',); my $net_telnet = $mech->repl->repl->client; # Bridge deep into WWW:Telnet for finer control $net_telnet->telnet->max_buffer_length($telnet_max_buff_len); # Enable buffer size to handle large webpage $mech->get($url); # Grab the content my $png = $mech->content_as_png(); # Dump to a PNG file open my $out, '>', $outfile or die "Couldn't create '$outfile': $!"; binmode $out; # Enable binary mode print {$out} $png; # Write the file to disk