473,237 Members | 1,070 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,237 software developers and data experts.

IEC - cannot find button

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

Oct 29 '07 #1
2 3169
On Oct 29, 12:58 am, daniel_no...@msn.com 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/p...ough-tutorial/

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

Oct 29 '07 #2
On Oct 29, 6:04 am, kyoso...@gmail.com wrote:
On Oct 29, 12:58 am, daniel_no...@msn.com 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/p...-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

Oct 29 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: rossum | last post by:
I am using Visual C# Express Beta, though I suspect that my question has more to do with .NET than with C# specifically. I have written a form with a Web Browser in it. At the top I have a button...
0
by: Daryl Zavier | last post by:
Hi Gurus, Please forgive me if my question is dumb cause this is my first web application I've done. Currently in my web application there is a button to click which will fire off a DTS event...
0
by: bill yeager | last post by:
I have a datalist displaying parent information and a datagrid presenting child information. The data is being rendered just fine. The datagrid has template columns on it that I cannot gain access...
0
by: Mohammad Ali via DotNetMonster.com | last post by:
hi guys, I have a problem with my datagrid. My form is set up so I have two textboxes an add button and an editable datagrid. The datagrid is bound to a datatable which is in my cache.When I...
6
by: chanmm | last post by:
Dear all, I have run the same web application in my Windows XP Pro without any problem but once I deploy it in Windows 2003 Server the message below appear: The system cannot find the file...
3
by: OJ | last post by:
Hi, I have added code to run on a button click event which adds usercontrols to an asp:Panel control held in a contentplaceholder defined by the masterpage. for (int x = 0; x <...
0
by: AngelaMDick | last post by:
AngelaMD...@gmail.com View profile More options 12 Nov, 14:43 Newsgroups: microsoft.public.dotnet.csharp.general From: AngelaMD...@gmail.com Date: Mon, 12 Nov 2007 06:43:21 -0800 Local: Mon...
0
by: pankajprakash | last post by:
Hi all I am using the Ajax control toolkit and want to the fill the gridview but at the time of rendering it occurs the error "Sys.ArgumentNullException: Value cannot be null. Parameter name:...
2
by: karinmorena | last post by:
I'm having 4 errors, I'm very new at this and I would appreciate your input. The error I get is: Week5MortgageGUI.java:151:cannot find symbol symbol: method allInterest(double,double,double)...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.