Javascript has been a problem for page scraping. People have tried to go around it by, say, recording the actual http parameters, which is not relevant to your problem. The other approach is to drive IE using
Win32::OLE. I used
Win32::IE::Mechanize before, but it's mainly for navigation/parsing, you/someone needs to figure out how to call the "Save As" method from COM.
I didn't know "Save As Text" will evaluate javascript printing. I tried it out, apparently it works.
Updated. just saw the module Win32::CaptureIE, it looks more promising.