Hi all

Am trying to read an html page using win32com in the following way.

 

from win32com.client import Dispatch

ie = Dispatch("InternetExplorer.Application")

ie.Navigate("https://secure.authorize.net/")

doc =ie.Document

print doc.body.innerHTML

 

with this code am easily able to read the mentioned page from the pythonwin interactive window, but the same code if I write it in some *.py file, am not able to read the page.

 

The following error it throws when I compile the file.

 

Traceback (most recent call last):

  File "C:\Python23\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript

    exec codeObject in __main__.__dict__

  File "C:\Python23\Lib\site-packages\Script1.py", line 14, in ?

    ie.Quit()

  File "C:\Python23\Lib\site-packages\win32com\client\__init__.py", line 456, in __getattr__

    return self._ApplyTypes_(*args)

  File "C:\Python23\Lib\site-packages\win32com\client\__init__.py", line 446, in _ApplyTypes_

    return self._get_good_object_(

com_error: (-2147352567, 'Exception occurred.', (0, None, None, None, 0, -2147467259), None)

 

if any body has the answer for this please help me in this.

 

Thanks and regards

Yogi

-----------------------------------------------------------------------------------------------------------------------------
Disclaimer
-----------------------------------------------------------------------------------------------------------------------------

"This message(including attachment if any)is confidential and may be 
privileged.Before opening attachments please check them
for viruses and defects.MindTree Consulting Private Limited (MindTree)will not 
be responsible for any viruses or defects or
any forwarded attachments emanating either from within MindTree or outside.If 
you have received this message by mistake please notify the sender by return  
e-mail and delete this message from your system. Any unauthorized use or 
dissemination of this message in whole or in part is strictly prohibited.  
Please note that e-mails are susceptible to change and MindTree shall not be 
liable for any improper, untimely or incomplete transmission."

-----------------------------------------------------------------------------------------------------------------------------
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to