473,382 Members | 1,313 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,382 software developers and data experts.

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 3068
Something like this should be close:

import win32com.client, pythoncom
ie=win32com.client.Dispatch('internetexplorer.appl ication')
ie.Visible=1
ie.Navigate('somepagewithjavascript.html')
id=ie.Document.Script._oleobj_.GetIDsOfNames('some jsfunction')
res=ie.Document.Script._oleobj_.Invoke(id, 0, pythoncom.DISPATCH_METHOD,
True, <parameter or tuple of parameters> )

hth
Roger
"Ishpeck" <is*****@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.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.client.Dispatch('internetexplorer.appl ication')
ie.Visible=1
ie.Navigate('somepagewithjavascript.html')
id=ie.Document.Script._oleobj_.GetIDsOfNames('some jsfunction')
res=ie.Document.Script._oleobj_.Invoke(id, 0, pythoncom.DISPATCH_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.DISPATCH_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.googlegr oups.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
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...
25
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...
1
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...
11
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...
11
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 ......
3
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...
9
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...
26
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...
1
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...
2
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.