0

我想知道如何使用PAMIE更改窗口。我正在使用它使用密码登录网站,然后单击一些链接和屏幕。登录后,下一个屏幕是一个新窗口,无法进入该窗口。

from PAM30 import PAMIE
ie1 = PAMIE()

website = "my website"
ie1.navigate(website)
ie1.setTextBox("username", "my username")
ie1.setTextBox("password", "my password")
ie1.clickButton("btnSubmit")
ie1.clickLink("EREP")
ie1.changeWindow("new window name") 
ie1 = None

我收到以下错误:

Traceback (most recent call last):
File "C:/Python32/test3", line 13, in <module>
  ie1.changeWindow("new window name")
File "C:\Python32\lib\site-packages\PAM30.py", line 197, in changeWindow
  newWin = self.windowFind(wintext)
AttributeError: 'PAMIE' object has no attribute 'windowFind'
4

1 回答 1

0

I dont know about PAMIE, but I have done something like what you describe with IEC.

这个片段打开一个 url,点击一个链接打开一个弹出窗口,然后弹出来做一些事情。之后弹出窗口关闭。

ie = IEC.IEController()
ie.Navigate(url)
ie.PollWhileBusy()

while True:

    time.sleep(sleeptime)
    ie.ClickLink("show Fullscreen")
    ie.PollWhileBusy()
    popup = IEC.IEController(window_url='jpg')
    img =  popup.GetCurrentUrl()
    # ... do some stuff
    popup.CloseWindow()
    ie.ClickLink('Next Image ')

如果您不依赖于 PAMIE,它可能是一个开始的地方。

于 2011-11-17T08:29:39.400 回答