Re: problem with from win32com.client import Dispatch
- From: "calfdog@xxxxxxxxx" <calfdog@xxxxxxxxx>
- Date: 14 Nov 2005 07:14:27 -0800
Hello,
If you want some goood examples of reading Web pages and automating
this process
I have a class that wraps all these functions.
http://pamie.sourceforge.net
But for your problem:
You are trying to read the page before it is completely loaded
either add a wait function or a simple sleep ( see below)
from win32com.client import Dispatch
import time
ie = Dispatch("InternetExplorer.Application")
ie.Navigate("https://secure.authorize.net/")
# ie.Visible = True
time.sleep(1)
doc = ie.Document
print doc.body.innerHTML
or with a wait function
from win32com.client import Dispatch
import time
def wait(ie):
while ie.Busy:
time.sleep(0.5)
while ie.Document.readyState != "complete":
time.sleep(0.5)
ie = Dispatch("InternetExplorer.Application")
ie.Navigate("https://secure.authorize.net/")
# ie.Visible = True
wait(ie)
doc = ie.Document
print doc.body.innerHTML
Enjoy
Robert Marchetti
.
- Follow-Ups:
- Re: problem with from win32com.client import Dispatch
- From: muttu2244
- Re: problem with from win32com.client import Dispatch
- References:
- problem with from win32com.client import Dispatch
- From: muttu2244
- problem with from win32com.client import Dispatch
- Prev by Date: Re: SciPy python 2.4 wintel binaries
- Next by Date: DB API specification of .rowcount and/or execute
- Previous by thread: problem with from win32com.client import Dispatch
- Next by thread: Re: problem with from win32com.client import Dispatch
- Index(es):