How to suppress SaveAs dialog box from IE?

logistix logistix at zworg.com
Tue Jan 7 00:48:58 EST 2003


mmikic at jwmp.com (Milan Mikic) wrote in message news:<6eabbea7.0301060721.2643580b at posting.google.com>...
> Dear All,
> 
> I'm trying to script IE using win32com to save a web page. My problem
> is that IE allways pops up a dialog box. Does anyone know how to
> suppress it?
> 
> My code is as follows:
> 
> import win32com.client,time,string
> ie = win32com.client.DispatchEx("InternetExplorer.Application")
> ie.Navigate("https://cds.jpmorgan.com/creditderivatives/cgi-bin/MPshowCurves?market=ASA")
> doc = ie.Document
> doc.ExecCommand("SaveAs",0,"c:\\temp\\fihur.htm")
> 
> Where am I going wrong?
> 
> Many Thanks,
> Milan

As I'm sure you've noticed, the IE COM component docs really suck ;)

Try using doc.body.innerhtml to grab the html directly instead of
using IE's "save as" function.

You'll also need a loop like:

while ie.ReadyState != 4:
    pass

before that to make sure that the page is completely loaded first.




More information about the Python-list mailing list