我得到一個類型錯誤與PAMIE上的一個非常簡單的腳本,我不知道我能做什麼。我找到了一個答案,暗示圖書館pywin32
可能沒有爲此特定方法設置self
參數(getElementsByTagName
),但我不確定,因爲我不知道在哪裏找到它的定義。類型錯誤與PAMIE
from PAM30 import PAMIE
ie = PAMIE()
ie.navigate('google.com')
ie.getButtons()
ie.quit()
print 'done'
的錯誤是:
Traceback (most recent call last):
File "c:\pamie1.py", line 1, in <module>
from PAM30 import PAMIE
File "C:\Python27\Lib\site-packages\PAM30.py", line 678, in getButtons
return self.getElementsList("input", filter)
File "C:\Python27\Lib\site-packages\PAM30.py", line 939, in getElementsList
elements = self._ie.Document.getElementsByTagName(tag)
TypeError: getElementsByTagName() takes exactly 1 argument (2 given)
下面是使用的是Windows在PAM30
elements = self._ie.Document.getElementsByTagName(tag)
其中_ie_
是
self._ie = win32com.client.dynamic.Dispatch('InternetExplorer.Application')
違規行我7x64與Python2.7 32位
如果您使用'from cPAMIE import PAMIE',是否會發生同樣的事情? – 2012-07-20 14:21:12
@César我得到'ImportError:No module named cPAMIE' – TankorSmash 2012-07-20 15:34:57
很奇怪,它是PAMIE 2.0嗎?我正在關注這個[tutorial](http://pamie.sourceforge.net/tutoriala.html) – 2012-07-20 15:38:52