About WebBrowser

Syver Enstad syver at NOSPAMcyberwatcher.com
Sat Dec 23 22:43:36 CET 2000


"Syver Enstad" <syver at NOSPAMcyberwatcher.com> wrote in message
news:9235bj$6e6$1 at troll.powertech.no...
>
> "Juan Huertas" <jhg at galdon.com> wrote in message
> news:91vbr9$eo1q2 at SGI3651ef0.iddeo.es...
> > It's possible to print the content of a Html page using the webbrowser
> > module into a python module?
>
> I am not sure what you're thinking about here. But I'll try, if it's
> possible to print with the webbrowser COM component from the dispatch
> interface it presents it is possible to do it from Python, but is that
what
> you're asking for?
>
Okay so I had to find out, is this what you're looking for?

import win32com.client
from win32com.client import constants
browser = win32com.client.Dispatch('InternetExplorer.Application')
browser.Visible = -1
browser.Navigate('www.python.org')
browser.ExecWB(constants.OLECMDID_PRINT, constants.OLECMDEXECOPT_PROMPTUSER)

PS: Remember to use the makepy utility to generate wrapper classes and
constants for you.





More information about the Python-list mailing list