COM (DispatchEx) problem

L

Leszek

Hi everybody !

I'm starting my script with:

ie = win32com.client.DispatchEx("InternetExplorer.Application")
ie.Visible = 1
ie.Navigate("http://www.chip.pl")

while ie.Busy == True:
win32api.Sleep(1000)

doc = ie.document

then I make "submit" and new page opens.
but

print doc.body.innerHtml

gives the same Html code than before "submit". What is going on ? How to see
new document ?

Thanks for any help.

Leszek
 
P

Paul McGuire

Leszek said:
Hi everybody !

I'm starting my script with:

ie = win32com.client.DispatchEx("InternetExplorer.Application")
ie.Visible = 1
ie.Navigate("http://www.chip.pl")

while ie.Busy == True:
win32api.Sleep(1000)

doc = ie.document

then I make "submit" and new page opens.
but

print doc.body.innerHtml

gives the same Html code than before "submit". What is going on ? How to see
new document ?

Thanks for any help.

Leszek
If you are just trying to get at the HTML source for a given URL, use urllib
or urllib2.

Here's the code to get the HTML source for yahoo.com:

import urllib
serverListPage = urllib.urlopen( "http://www.yahoo.com" )
htmlSource = serverListPage.read()
serverListPage.close()

Bypasses the whole COM and IE mess, and it's portable, to boot!

-- Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top