简体   繁体   English

使用Java登录网站

[英]Logging into a website using java

I'm looking for a solution to login to a website using a java program. 我正在寻找一种使用java程序登录网站的解决方案。

I found a good script over here: 我在这里找到了一个不错的脚本:

http://www.dreamincode.net/forums/blog/114/entry-2715-login-to-a-website-from-java/ http://www.dreamincode.net/forums/blog/114/entry-2715-login-to-a-website-from-java/

But the trouble is with handling cookies? 但是麻烦在于处理cookie吗? How can I get the cookie info. 如何获取Cookie信息。 send by the server? 由服务器发送? Thanks 谢谢

选中JAAS ,以将其用于自动登录;如果使用的是IBM WebSphere,请选中“信任关联拦截器”

Use HtmlUnit Framework. 使用HtmlUnit框架。 or Apache httpclient framework. 或Apache httpclient框架。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM