6 Replies - 1996 Views - Last Post: 18 August 2008 - 08:13 PM Rate Topic: -----

#1 itpro4470  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 5
  • View blog
  • Posts: 156
  • Joined: 17-June 07

Invoking Javascript methods in python

Posted 05 August 2008 - 08:51 PM

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: 05 August 2008 - 10:36 PM

Is This A Good Question/Topic? 0
  • +

Replies To: Invoking Javascript methods in python

#2 linuxunil  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 5
  • View blog
  • Posts: 46
  • Joined: 07-March 06

Re: Invoking Javascript methods in python

Posted 06 August 2008 - 05:41 AM

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.
Was This Post Helpful? 0
  • +
  • -

#3 perfectly.insane  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 70
  • View blog
  • Posts: 644
  • Joined: 22-March 08

Re: Invoking Javascript methods in python

Posted 15 August 2008 - 03:16 AM

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).
Was This Post Helpful? 0
  • +
  • -

#4 yanom  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 70
  • Joined: 05-April 08

Re: Invoking Javascript methods in python

Posted 15 August 2008 - 03:36 PM

Quote

If this happens to be on Windows

in case you failed to notice, his OS of choice is Linux
Was This Post Helpful? 0
  • +
  • -

#5 KYA  Icon User is offline

  • g++ jameson.cpp -o beverage
  • member icon

Reputation: 3106
  • View blog
  • Posts: 19,145
  • Joined: 14-September 07

Re: Invoking Javascript methods in python

Posted 15 August 2008 - 03:37 PM

just cause the penguin is there doesn't mean that is all he uses...
Was This Post Helpful? 0
  • +
  • -

#6 itpro4470  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 5
  • View blog
  • Posts: 156
  • Joined: 17-June 07

Re: Invoking Javascript methods in python

Posted 18 August 2008 - 06:04 PM

Yes my primary OS is linux but I do run Windows in a virtualization program. I put it in a box where it belongs :). This particular program I'm writing in Linux.
Was This Post Helpful? 0
  • +
  • -

#7 perfectly.insane  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 70
  • View blog
  • Posts: 644
  • Joined: 22-March 08

Re: Invoking Javascript methods in python

Posted 18 August 2008 - 08:13 PM

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.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1