use strict; use LWP::Simple; use Win32::GuiTest qw( WaitWindowLike SetForegroundWindow SendKeys ); my $url = q(http://www.cnn.com); my $fn = $ENV{TEMP}."\\test.html"; getstore ($url, $fn); my $prg = qq(start rundll32 mshtml.dll,PrintHTML "$fn"); system $prg; $_ = WaitWindowLike( 0, qr/Apply/i, undef , undef, undef, 10000); SetForegroundWindow($_); SendKeys ("{ENTER}"); print "Printed ",-s $fn, " bytes from $url";