On Oct 29, 6:04 am, [EMAIL PROTECTED] wrote: > On Oct 29, 12:58 am, [EMAIL PROTECTED] wrote: > > > > > I'm brand new to Python--and programming in general. I'm trying to use > > IEC to control Internet Explorer. I've navigated to a page, and now > > I'm trying to click a button. The button appears to be called 'PDF > > Preview' but I honestly do not know whether that's the name or the > > caption. Here is my code: > > > from win32com.client import Dispatch > > import IEC > > > . > > . > > . > > > ie = IEC.IEController(window_num = 1) > > ie.Navigate(URL_part_1 + x + URL_part_2) > > ie.ClickButton(name='PDF Preview') > > > (I've also tried replacing name w/ caption but I get a similar error > > message.) I get this error message: > > > Traceback (most recent call last): > > File "C:\Program Files\Python25\experiment", line 14, in <module> > > ie.ClickButton(name='PDF Preview') > > File "C:\Program Files\Python25\lib\IEC.py", line 126, in > > ClickButton > > elem = elemcoll.item(i) > > File "<COMObject <unknown>>", line 3, in item > > com_error: (-2147024891, 'Access is denied.', None, None) > > > I really have no idea how to interpret this. I'm pasting the button > > tag below: > > > <td> > > <input type="button" value="PDF Preview" > > onclick="javascript:performPdfPreview(2);"/> > > </td> > > You might want to look at PAMIE instead. It sounds like a Python > project that's aimed at automating Internet > Explorer:http://sourceforge.net/projects/pamie/ > > But if you really like COM, I found this tutorial: > > http://www.evilbitz.com/2006/10/22/python-ie-automation-thorough-tuto... > > I'm not very good with COM, but I would recommend that you do some > research on it. From the traceback, I would guess that you don't have > administrator privileges (of some sort) on the machine you're running > the script on. > > Mike
Thanks for the input, Mike. Since I don't have much experience w/ either, I don't have a strong preference for COM over PAMIE. I'm just frustrated my script isn't working. I guess it could have to do w/ privileges. I'm using a VPN connection. I tried turning off my antivirus software before running the module. I can click on the button I want manually, and get the page I need, so I wonder if I can adjust some settings to allow Python to take control of certain things? That or I thought it might have to do w/ a javascript error. By looking at the tag, does 'PDF Preview' look like the name of the button or the button caption? Let me know what you think. Daniel -- http://mail.python.org/mailman/listinfo/python-list