Yes, but this will not solve the problem, it still fails with error: "object <doc> has no property <title>"
> -----Original Message----- > From: users-boun...@lists.ironpython.com [mailto:users- > boun...@lists.ironpython.com] On Behalf Of Dickson, Madison J > Sent: Thursday, July 29, 2010 8:00 PM > To: users@lists.ironpython.com > Subject: Re: [IronPython] Users Digest, Vol 72, Issue 74 > > are you missing the "ie = w" > > in the first example? > > ________________________________________ > From: users-boun...@lists.ironpython.com [users- > boun...@lists.ironpython.com] On Behalf Of users- > requ...@lists.ironpython.com [users-requ...@lists.ironpython.com] > Sent: Wednesday, July 28, 2010 4:09 PM > To: users@lists.ironpython.com > Subject: Users Digest, Vol 72, Issue 74 > > Send Users mailing list submissions to > users@lists.ironpython.com > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > or, via email, send a message with subject or body 'help' to > users-requ...@lists.ironpython.com > > You can reach the person managing the list at > users-ow...@lists.ironpython.com > > When replying, please edit your Subject line so it is more specific than "Re: > Contents of Users digest..." > > > Today's Topics: > > 1. Shell.Application.Windows (Lacko Roman) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 28 Jul 2010 17:21:15 +0200 > From: Lacko Roman <rla...@gratex.com> > To: "users@lists.ironpython.com" <users@lists.ironpython.com> > Subject: [IronPython] Shell.Application.Windows > Message-ID: > > <a76e2ee7ba21494fb90249f8809c28b9a89cec6...@mbx.hq.gratex.com> > Content-Type: text/plain; charset="us-ascii" > > Hi, > > I have problem with following code, where call to [doc.title] failes: > > # GET ALL INTERNET EXPLORER WINDOWS > app = > System.Activator.CreateInstance(System.Type.GetTypeFromProgID("Shell.A > pplication")) > for w in app.Windows(): > try: > print w.Type() > # CHECK IF THIS WINDOW HOLDS HTML > if (w.Type() == "HTML Document"): > doc = ie.document > # THIS WILL FAIL WITH "object <doc> has no property <title>" > print doc.title > break > except Exception, e: > print e > > All I want is to get specific internet explorer window and get some info from > the document > > This code is working in Cpython with win32com: > > app = win32com.client.Dispatch("Shell.Application") > for w in app.Windows(): > try: > print w.Type > if (w.Type == "HTML Document"): > ie = w > doc = ie.document > print doc.title > break > except Exception, e: > print e > > Thanks in advance > > -Roman > > > ------------------------------ > > _______________________________________________ > Users mailing list > Users@lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > End of Users Digest, Vol 72, Issue 74 > ************************************* > _______________________________________________ > Users mailing list > Users@lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com