$IE->Navigate($root_url.$fname.$end_url); while ($IE->{Busy}) { Win32::Sleep 500; Win32::OLE->SpinMessageLoop(); } my $content = $IE->Document()->body()->innerHTML(); my $fh = IO::File->new(">>$save_dir/$fname.htm"); print $fh $content; $fh->close();