本文介绍了单独的IE实例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要创建一组具有不同

会话cookie的IE实例。我认为使用win32com.DispatchEx函数

会这样做,但它似乎没有。换句话说


ie1 = win32com.DispatchEx(" InternetExplorer.Application")

ie2 = win32com.DispatchEx(" InternetExplorer.Application")


给了我两个IE窗口,但在任务管理器中只有一个IEXPLORE进程。

如果我登录到使用会话cookie跟踪会话的网站

使用ie1,当我将ie2移动到同一个站点时,ie2已经登录。


任何帮助表示赞赏。


-Chris

解决方案




来自win32com.client import Dispatch


ie1 = pythoncom.CoCreateInstance(" InternetExplorer.Appli cation",None,\

pythoncom.CLSCTX_SERVER,

pythoncom。 IID_IDispatch)

ie1 = Dispatch(ie1)

ie2 = pythoncom.CoCreateInstance(" InternetExplorer.Appli cation",None,\

pythoncom.CLSCTX_SERVER,

pythoncom.IID_IDispatch)

ie2 =派遣(ie2)

..

..

..





我可能会离开,但是不是那些操作系统的窗户之一br />
允许你有两个IEXPORE.EXE实例运行IOW操作系统是
阻止你运行这个可执行文件的两个实例。有人对b / b
了解更多关于Windows内部的知识我肯定会来

并纠正我;-)


Mart


I need to create a set of IE instances that have different sets of
session cookies. I thought that using the win32com.DispatchEx function
would do this, but it doesn''t seem to. In other words

ie1 = win32com.DispatchEx("InternetExplorer.Application" )
ie2 = win32com.DispatchEx("InternetExplorer.Application" )

gives me two IE windows, but only one IEXPLORE process in Task Manager.
And if I login to a site that uses session cookies to track sessions
using ie1, when I move ie2 to the same site, ie2 is already logged in.

Any help appreciated.

-Chris

解决方案



from win32com.client import Dispatch

ie1 = pythoncom.CoCreateInstance("InternetExplorer.Appli cation", None,\
pythoncom.CLSCTX_SERVER,
pythoncom.IID_IDispatch)
ie1 = Dispatch(ie1)
ie2 = pythoncom.CoCreateInstance("InternetExplorer.Appli cation", None,\
pythoncom.CLSCTX_SERVER,
pythoncom.IID_IDispatch)
ie2 = Dispatch(ie2)
..
..
..




I could be way off, but isn''t windows one of those OS''s that doesn''t
allow you to have two instances of IEXPORE.EXE running IOW the OS is
preventing you from running two instances of this executable. Someone
with a lot more knowledge of windows internals will I''m sure come along
and correct me ;-)

Mart


这篇关于单独的IE实例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-25 04:55