Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypeError with PAMIE

I am getting a TypeError with a very simple script on PAMIE, and I'm not sure what I can do. I had found an answer suggesting that the library, pywin32 might not have set a self argument for this particular method (getElementsByTagName) but I don't know for sure, as I don't know where to find the definition of it.

from  PAM30 import PAMIE

ie = PAMIE()
ie.navigate('google.com')
ie.getButtons()
ie.quit()
print 'done'

The error is:

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)

Here's the offending line in PAM30

elements = self._ie.Document.getElementsByTagName(tag)

where _ie_ is

self._ie = win32com.client.dynamic.Dispatch('InternetExplorer.Application')

I'm using Windows 7x64 with Python2.7 32bit

like image 571
TankorSmash Avatar asked May 15 '26 07:05

TankorSmash


1 Answers

sourceforge bug link

"Workaround" seems to be enable Compatibility View (Tools > Compatibility View settings > Display all websites in Compatibility View).

it is a bug of IE.

like image 80
likaiguo.happy Avatar answered May 17 '26 20:05

likaiguo.happy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!