javascript execution from Python script

Justin Guerin jguerin at cso.atmel.com
Mon Aug 26 21:45:22 CEST 2002


On Monday 26 August 2002 12:10 pm, Matt Gerrans wrote:
> Java and JavaScript are entirely different and unrelated animals; the fact
> that they have similar names is just the result of a horrible marketing
> blunder.  

I had no idea they were THAT unrelated.

> Jython is very nifty and allows you to call Java from Python and
> vice versa (in fact, regarding the eternal question of Tkinter vs.
> wxWindows et al, I am beginning to like the idea of using Swing via
> Jython), but from what you've said it looks like you are really more
> interested in JavaScript, not Java.
>
> What exactly are you trying to accomplish?

I administer a 3rd party software program that has a web based interface.  I 
want to automate some of the repetitive tasks I find myself doing often, but 
I can't get directly to the internals, so I figured I could write a script to 
drive the web based interface.  Many pages contain javascript, and most of 
the scripting can be done by massaging the javascript source, but as for the 
rest, I'd rather not write unique code for it.  After all, I can't really 
control when the interface changes.

>
> Also, what platform are you using?    If it is Windows, then there may be
> hope of solving your problem using the Windows Script Host; Python works
> pretty well with it.   Python can also be used to automate Internet
> Explorer on the Windows platform (I wonder if that can be done on the Mac
> platform as well?).   If it is Unix/Linux, I'm not sure what options you
> have.

I'm using Linux to develop, but right now, our server is on NT.  I could run 
the script from my desktop under Linux, but I think I'd lose the ability to 
reboot the server, should that become necessary.  Also, it is possible that 
our server will move to Unix at some time, so a maximum of portability is 
important.

Thanks to Gerhard, Guyon, Paul and Matt for your insights and assistance.  
It's good to know I'm not just missing something.

Justin




More information about the Python-list mailing list