Getting exceptions when catching events while
interacting with InternetExplorer.Application.
Class connects to IE via
self.ie =
DispatchWithEvents("InternetExplorer.Application",
InternetExplorerEvents)
Subsequent events on some (not all) URLs cause
exceptions as follows:
pythoncom error: Python error invoking COM method.
Traceback (most recent call last):
File
"C:\Python24\Lib\site-packages\win32com\server\policy.py",
line 285, in _Invoke_
return self._invoke_(dispid, lcid, wFlags, args)
File
"C:\Python24\Lib\site-packages\win32com\server\policy.py",
line 290, in _invoke_
return S_OK, -1, self._invokeex_(dispid, lcid,
wFlags, args, None, None)
File
"C:\Python24\Lib\site-packages\win32com\server\policy.py",
line 653, in _invokeex_
args, kwArgs = self._transform_args_(args, kwArgs,
dispid, lcid, wFlags, serviceProvider)
File
"C:\Python24\Lib\site-packages\win32com\server\policy.py",
line 648, in _transform_args_
arg = str(arg)
exceptions.UnicodeEncodeError: 'ascii' codec can't
encode character u'\xae' in position 67: ordinal not in
range(128)
URL being accessed via
self.ie.Navigate( url )
A number of URLs lead to the behavior including the
following:
http://www.cnb.com:80/
http://www.cnb1.com:80/
http://www.charterbankcc.com:80/
http://www.charterbankec.com:80/
I can provide test code if it is helpful.
|