[python-win32] win32com getElementsByClassName error
Anthony Andriano
anthonyandriano at gmail.com
Fri May 24 01:46:01 CEST 2013
I'm trying to navigate through in intranet site using python. Everything
works as expected until I try to get an element.
>>> import win32com.client
>>> ie = win32com.client.DispatchEx("InternetExplorer.Application")
>>> ie.visible = 1
>>> ie.Navigate(url)
# I waited long enough by inspection
>>> toButton = ie.Document.getElementsByClassName(className)[1]
Which results in:
TypeError: getElementsByClassName() takes exactly 1 argument (2 given)
Is it passing self to the function? I don't even know what self is in this
context. Trying to get an element by ID works just fine with
getElementByID, but the element I need to click doesn't have an ID.
I also can't get the click() method to work even when I can get the right
object. Is it supposed to be as easy as obj.click()?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20130523/af3a929a/attachment.html>
More information about the python-win32
mailing list