Printing Webpages from Internet Explorer with Python

This script calls the webpage in Internet Explorer and prints it to the standard printer.

Attention: use the utility (C:\\Python23\\Lib\\site-packages\\win32com\\client\\) on the “Microsoft Internet Controls (1.1)” object library to get early binding !!! Otherwise you cannot print !

from win32com.client import Dispatch
from time import sleep

ie = Dispatch(“InternetExplorer.Application”)
ie.Visible = 1
if ie.Busy:
# print the current IE document without prompting the user for the printerdialog
ie.ExecWB(win32com.client.constants.OLECMDID_PRINT, \