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 2 3193
On Oct 29, 12:58 am, daniel_no...@ms n.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.IEControlle r(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="javasc ript:performPdf Preview(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
On Oct 29, 6:04 am, kyoso...@gmail. com wrote:
On Oct 29, 12:58 am, daniel_no...@ms n.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.IEControlle r(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="javasc ript:performPdf Preview(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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 bar. What
I want to do is to have a button which searches for
user-entered text in the HTML document in the Web Browser.
When I run my form I can type Ctrl-F and up comes a standard Find
dialogue box which does exactly what I want - the...
|
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 to import data into my SQL server. During the importing
process, there're also several calculation made to amend/modify the import
data accordingly.
|
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 to in my Itemcommand event
of the datalist.
When I press a button on the datalist, that brings me
into the Itemcommand event. I have access to the datagrid
control, but not any column controls on the datagrid. For
instance, my first column is...
|
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
click the add button the contents of the
textboxes are insertedinto the datatabel in teh cache and the datagrid is
bound to it.
However the problem comes when I delete a row from the database and then
|
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 specified. (Exception from HRESULT:
0x80070002)
I checked all the files I need in those paths and nothing is missing in
fact. Anyone can help?
| |
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 < (Master.PartyCtrl.Adults ); x++)
{
ASP.usercontrols_passenger_ascx passenger = new
ASP.usercontrols_passenger_ascx();
this.pnlAdults.Controls.Add(passenger);
|
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 12 Nov 2007 14:43
Subject: Events give "Page cannot be displayed"
Reply | Reply to author | Forward | Print | Individual message | Show
original | Remove | Report this message | Find messages by this
|
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: element". Here am posting the whole .ascx page.
Will you please let me know how can i remove this error.
|
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)
Location: class Week5MortgageGUI
Week5MortgageLogic allint = logic.allInterest(amount, term, rate);
Week5MortgageGUI.java:152:cannot find symbol
symbol: method allInterest(double,double,double)
Location: class Week5MortgageGUI
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |