473,800 Members | 2,495 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Internet Explorer, COM+, Javascript and Python

I need to make IE execute javascript in a web page with COM+ and
Python.

Similarly to the way they do it in this article. . .

http://www.codeproject.com/com/jscalls.asp

Jul 19 '05 #1
4 3090
Something like this should be close:

import win32com.client , pythoncom
ie=win32com.cli ent.Dispatch('i nternetexplorer .application')
ie.Visible=1
ie.Navigate('so mepagewithjavas cript.html')
id=ie.Document. Script._oleobj_ .GetIDsOfNames( 'somejsfunction ')
res=ie.Document .Script._oleobj _.Invoke(id, 0, pythoncom.DISPA TCH_METHOD,
True, <parameter or tuple of parameters> )

hth
Roger
"Ishpeck" <is*****@gmail. com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
I need to make IE execute javascript in a web page with COM+ and
Python.

Similarly to the way they do it in this article. . .

http://www.codeproject.com/com/jscalls.asp


----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Jul 19 '05 #2

"Roger Upole" <ru****@hotmail .com> wrote in message
news:42******** **@127.0.0.1...
Something like this should be close:

import win32com.client , pythoncom
ie=win32com.cli ent.Dispatch('i nternetexplorer .application')
ie.Visible=1
ie.Navigate('so mepagewithjavas cript.html')
id=ie.Document. Script._oleobj_ .GetIDsOfNames( 'somejsfunction ')
res=ie.Document .Script._oleobj _.Invoke(id, 0, pythoncom.DISPA TCH_METHOD,
True, <parameter or tuple of parameters> )

hth
Roger
Yes, that definitely works. Only one minor correction: it seems that to
pass multiple parameters you need to pass them sequentially seperated by
commas instead of in a tuple, i.e.
res=ie.Document .Script._oleobj _.Invoke(id, 0, pythoncom.DISPA TCH_METHOD,
True, param1, param2, param3, ......... )

Useful test sitefor above code:
http://www.cpplab.com/Articles/JSCal...llTestPage.htm

HTH,


"Ishpeck" <is*****@gmail. com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
I need to make IE execute javascript in a web page with COM+ and
Python.

Similarly to the way they do it in this article. . .

http://www.codeproject.com/com/jscalls.asp

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet

News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups ----= East and West-Coast Server Farms - Total Privacy via Encryption

=----

Jul 19 '05 #3
Do you guys know if there is a way to do this in Linux?
Thanks.

Danny

Jul 19 '05 #4
dannyguindi wrote:
Do you guys know if there is a way to do this in Linux?


What is "this"? Your subject line provides a context, but not a problem
to which we can give you the solution. Please be specific.

-Peter
Jul 19 '05 #5

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

Similar topics

2
10037
by: Yurij Nykon | last post by:
Hi all. How can I detect the version of Flash-Plugin installed in Internet Explorer? In Netscape i can do this with following java script navigator.plugins.description But it doesn't works in IE? Can anyone help me? Thanx in advance,
25
4331
by: Jeff | last post by:
Use the MS Script Editor included free with MS Office 2002 and above, for debugging Internet Explorer (IE). This subject is of great interest to many JS developers, as there is no obvious, low cost way to do sophisticated debugging in IE6 other than to use the debugger described below, which is horribly documented otherwise. I feel debugging is an important aspect of projecting the useability of the language and needs to be made more...
1
3511
by: Apu Nahasapeemapetilon | last post by:
Hello and thank you in advance for your help. Can anyone think of a reason why this code would work properly on one PC, but not another? I've got a System.Windows.Forms.UserControl that products events which I want to consume (sink) within Internet Explorer. I'm following the instructions at: ms-http://support.microsoft.com/default.aspx?kbid=313891.
11
13405
by: Doug van Vianen | last post by:
Hi, I often like to include some JavaScript coding in my web pages to make them more interesting. Unfortunately, even when this coding is as simple as a check to see what the display width is in pixels so that pictures on the page can be adjusted to better fit the display, Internet Explorer detects the coding and blocks it. Of course the user can click on the message displayed above the web page to allow "the active component" but many...
11
2032
by: GHUM | last post by:
Hello, I created some rather complex Intranet Application, using lots of JavaScript, DOM-Maninpulation and XMLHTTPRequest communication. I developed on FireFox, with the excellent firebug ... every misstake was given back with a fine, fine traceback; exactly pointing to the code at error. My code runs fine on FireFox and Opera.
3
9589
by: Matthew Lock | last post by:
Hello, I am automating Internet Explorer in order to do some simple automated testing of a web application. How do I invoke Javascript functions in the web page I load? I can successfully start an instance of Internet Explorer and control the DOM, but I don't know how to call Javascript functions. Here is the code I am using so far: public class WebBrowser
9
1634
by: -Lost | last post by:
http://blogs.msdn.com/ie/archive/2007/12/19/internet-explorer-8-and- acid2-a-milestone.aspx Oh my! A somewhat standards compliant Internet Explorer? What about JavaScript? Not that it proves much, but it is definitely a huge step in the right direction. Bruce Lawson of The Web Standards Project seems optimistic albeit a
26
2288
by: Prisoner at War | last post by:
Hi, All: I have a JavaScript search engine that always causes MSIE 7 to do a top-of-page security "warning" (that top-of-page-bar, and not an "alert" )...but other websites' JavaScripts do not trigger that...what's going on? When I visit other JavaScript sites there's no warning and the scripts work fine, but mine (it's still under construction, offline) occasions that warning and I have to manually allow MSIE to run JavaScript every...
1
4855
by: avpkills2002 | last post by:
I seem to be getting this weird problem in Internet explorer. I have written a code for parsing a XML file and displaying the output. The code works perfectly fine with ffx(Firefox).However is not working in Internet Explorer.(I m using Internet Explorer 6.0). The code is as follows: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html...
2
3157
by: swethak | last post by:
Hi, I am getting the problem the problem with google map in Internet Explorer. This map worked fine in mozilla . When i opened the same map in Internet Explorer i am getting the error message as in alert box as " Internet Explorer cannot open the Internet site http://google.citycarrentals.com.au/viewalllocations.php . Operation aborted". It is working in Mozilla . Here i mentioned my code . I am facing this problem several...
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10505
Oralloy
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...
0
10275
jinu1996
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...
1
10253
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,...
0
10033
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5471
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
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 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.