Welcome to Dream.In.Code
Getting Help is Easy!

Join 132,661 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,172 people online right now. Registration is fast and FREE... Join Now!




Invoking Javascript methods in python

 
Reply to this topicStart new topic

Invoking Javascript methods in python

itpro4470
post 5 Aug, 2008 - 07:51 PM
Post #1


D.I.C Head

Group Icon
Joined: 17 Jun, 2007
Posts: 107



Dream Kudos: 25
My Contributions


I'm writing code to automate the sending of follow up emails from a proprietary site for the sales team I have to submit the emails through this web form but to send it I have to invoke a JavaScript function.If anyone knows where I can go or what I can read to be able to do something like this I would greatly appreciate it.

This post has been edited by itpro4470: 5 Aug, 2008 - 09:36 PM
User is offlineProfile CardPM

Go to the top of the page

linuxunil
post 6 Aug, 2008 - 04:41 AM
Post #2


New D.I.C Head

Group Icon
Joined: 7 Mar, 2006
Posts: 46



Thanked 2 times

Dream Kudos: 125
My Contributions


What does the javascript you need to invoke do. If it just posts the data to another page then that should be simple enough to do.
User is offlineProfile CardPM

Go to the top of the page

perfectly.insane
post 15 Aug, 2008 - 02:16 AM
Post #3


D.I.C Addict

Group Icon
Joined: 22 Mar, 2008
Posts: 557



Thanked 46 times

Dream Kudos: 25

Expert In: C/C++

My Contributions


If this happens to be on Windows, you can host the Microsoft JScript interpreter in your application using the Microsoft Scripting Control. The control gives you an execution environment from which you can evaluate such expressions, and of course load the support code (as that's why you're using JS, otherwise, you could more than likely do it straight from Python).
User is offlineProfile CardPM

Go to the top of the page

yanom
post 15 Aug, 2008 - 02:36 PM
Post #4


New D.I.C Head

*
Joined: 5 Apr, 2008
Posts: 46


My Contributions


QUOTE
If this happens to be on Windows

in case you failed to notice, his OS of choice is Linux
User is offlineProfile CardPM

Go to the top of the page

KYA
post 15 Aug, 2008 - 02:37 PM
Post #5


#include <nerd.h>

Group Icon
Joined: 14 Sep, 2007
Posts: 4,211



Thanked 50 times

Dream Kudos: 1150
My Contributions


just cause the penguin is there doesn't mean that is all he uses...
User is offlineProfile CardPM

Go to the top of the page

itpro4470
post 18 Aug, 2008 - 05:04 PM
Post #6


D.I.C Head

Group Icon
Joined: 17 Jun, 2007
Posts: 107



Dream Kudos: 25
My Contributions


Yes my primary OS is linux but I do run Windows in a virtualization program. I put it in a box where it belongs smile.gif. This particular program I'm writing in Linux.
User is offlineProfile CardPM

Go to the top of the page

perfectly.insane
post 18 Aug, 2008 - 07:13 PM
Post #7


D.I.C Addict

Group Icon
Joined: 22 Mar, 2008
Posts: 557



Thanked 46 times

Dream Kudos: 25

Expert In: C/C++

My Contributions


So, this is some JavaScript that you're trying to reuse? Is the function obfuscated? It seems like it would be easier to redo it in Python, or possibly even automate it directly in JavaScript within a web browser. I'm guessing that the question isn't really as generalized as it seemed at first, because even if you can find some way to host JavaScript from Python, the function in question probably needs the web browser to even function.
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/23/08 05:38AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month