使用 Python 自动化 Java 小程序
在工作中,我需要每 20-30 分钟运行一个 Java 小程序来重新连接到内部之一 应用程序。
我想自动登录该应用程序的网站,然后运行这个根本不需要任何输入的 Java 小程序,只需接受它,这样我就可以在每次应用程序注销时运行该脚本。
有什么方法可以使用 urllib 或类似的库在 Python 中做到这一点吗? 我知道如何执行登录部分,但我不知道如何执行“接受并运行此小程序”部分。
At work I need to run a Java applet every 20-30 min to re-connect to one of the internal
applications.
I would like to automate the login in the website of this application and then run this Java applet that does not require any input at all, just accept it so I can just run the script every time the application logs me off.
Is there any way I can do this from Python using urllib
or a similar library?
I know how to do the login part, but I don't know what to do the 'accept and run this applet' part.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Web 应用程序测试框架对于您的要求非常有用,它允许您模拟用户与网站的交互(POST、GET、登录、点击等)。
你的问题的棘手部分是与 Java 小程序交互 - 没有多少 Web 应用程序测试框架允许你这样做;特别是我不知道提供该功能的Python框架,但根据我的经验,我发现 HTTPUnit与小程序配合良好。当然,它是用 Java 编写的,而不是用 Python 编写的,但值得一看。
A web application testing framework would be useful for what you ask, it allows you to simulate the interactions of an user (POST, GET, login, clicks, etc.) with a web site.
The tricky part of your question, is interacting with a Java applet - not many webapp testing frameworks will allow you to do that; in particular I don't know a Python framework that offers that functionality, but in my experience, I found that HTTPUnit worked well with applets. Of course, it's in Java and not in Python, but it's worth checking out.