java 使用java登录网站
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5242593/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Logging into a website using java
提问by sreejith
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? How can I get the cookie info. send by the server? Thanks
但问题在于处理cookies?如何获取cookie信息。由服务器发送?谢谢
回答by Bassem Reda Zohdy
回答by deenfirdoush
Use HtmlUnit Framework. or Apache httpclient framework.
使用 HtmlUnit 框架。或 Apache httpclient 框架。